Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Brijendra Singh on Dec 21, 2009 06:56
open dhtmlx forum
Data Processor varificator

how can i restrict data verificator to verify just once cell rather than verifying entire row?
Answer posted by dhxSupport on Dec 21, 2009 08:19
You can use setVerificator method. This method specify column which value should be verified before sending to server. Please find example here http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/04_dataprocessor/05_basic_validation.html
and tutorial here http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxdataprocessor:api_method_dataprocessor_setverificator
Answer posted on Dec 21, 2009 08:57
Hi,
This example is also the same, if i edit one cell and click update it will also verify the other cells for that particular row. I want to edit only one cell then it should only verify one cell and send the data to the server, not like the one which is in the example.

Thanks,
brijendra
Answer posted by dhxSupport on Dec 22, 2009 01:53
>>This example is also the same, if i edit one cell and click update it will also verify the other cells for that particular row
You should define verificator only for one necessary column. 
Answer posted on Dec 22, 2009 02:18
Can you please tell me how to do that, right now the reference codes i see, its applied on the entire row.
if i use code below:
dp.setVerificator(0, some_function);
dp.setVerificator(3, some_function);

in this case verificator will verify both the columns in a row.
I did not found it in any documentation.
is there a method which restricts verificator to verify only one cell.
 
Answer posted by dhxSupport on Dec 22, 2009 06:24
>>in this case verificator will verify both the columns in a row.
You want to verify only one cell from the row, don't you? Then you should leave only:
dp.setVerificator(0, some_function); //verify only 1st cell.
some_function will be called only for the 1st cell from the cell, other cells from the row will not be verified. 

setVerificator method pass following parameters to the some_function:
* value -  value of the cell which should be verified
* rowId - id of the row
* cellIndex - index of a cell

function some_function(value,rowId,cellIndex){
if (value=="") return false;
else return true;
}