Use Generic Custom Validation

Hi,

I have to do the following validation on multiple columns (column 0, 3, 4). I had to write 3 methods for it. Please suggest how to make this into a generic method.

e.g.
mygrid.setColValidators([“ValidOption0”,null,null,“ValidOption3”,“ValidOption4”,null]);

dhtmlxValidation.isValidOption0=function(a){
return (mygrid.getCombo(0).values._dhx_find(a)!=-1)
}

dhtmlxValidation.isValidOption3=function(a){
return (mygrid.getCombo(3).values._dhx_find(a)!=-1)
}

dhtmlxValidation.isValidOption4=function(a){
return (mygrid.getCombo(4).values._dhx_find(a)!=-1)
}

There is no way to create generic method with validation functions.
But you can use “onEditCell” event and create custom validation rule. Please find more information here docs.dhtmlx.com/doku.php?id=dhtm … validation