Check documentation for the latest version 6.0 of dhtmlxSuite setVerificator DHTMLX Docs

setVerificator

specifies a column which values should be verified before sending to the server

void setVerificator(number index,function verifyFunc);

Parameters

indexnumberthe index of column
verifyFuncfunctiona function that will verify values of the specified column (if not set, the values will be compared to an empty string)

Example

// checks if the 1st column values is not equal to 0
myDataProcessor.setVerificator(0,greater_0);
 
function greater_0(value){
    return value>0;
}
 
//checks if the 2nd column values is not empty
myDataProcessor.setVerificator(1,not_empty);
 
function not_empty(value,id,ind){
    if (value=="") mygrid.setCellTextStyle(id,ind,"background-color:yellow;");
    return value!="";
}

Related samples

Details

Beware, the method is used for the Grid component only.

The verifying function goes through all cells of the column and takes 3 parameters:

  • value - the value of the cell
  • rowID - the row id
  • colInd - the column index
See also
Back to top