Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Adam Downs on Jul 08, 2009 13:58
open dhtmlx forum
Verify Data Validation For Entire Grid

I have 2 grids on a page each with its own data processor,
I am using the sendData command to first run checkBeforeUpdate to validate some columns in each that may or maynot have been edited then if not valid they highlight in red, If valid the data is saved to DB which is all to be expected.

However I need a way to validate both Grids and only save the data if both grids pass. If Validation fails on either grid I need to prevent the sendData commands for Both grids not just the one that fails Validation.

Basically I am looking for a function that returns true/false on a grid to verify all cells valid or not

I am Using dhtmlxSuite_2009Rel1_pro_90226.

Thanks in advance.
Answer posted by Support on Jul 09, 2009 03:07
You  can use next code 

var valid = true;
for (var i=0; i<dp.updatedRows.length; i++)
    valid&=dp.checkBeforeUpdate(dp.updatedRows[i]);


where dp - dataprocessor instance