Validation for Dhtmlxgrid

Are there any inbuilt validation for Dhtmlxgrid when adding a new row? For example, numbers allowed only or no null value, etc.

The grid has not any built in validators.
Component provides may events, which allow to attach custom code to different events of grid ( onRowCreated for example ) , by which any custom validation can be created

If you are using dataprocessor for saving data, it has some basic validation support.
dhtmlx.com/docs/products/dhtmlxG … 9671780000

How do i attach custom code to different columns because some requires integer validation and others do not allow empty values.

I’m not sure about exact use-case, which need to be implemented in your case, but for most events grid provides both id and index of cell in question , so it possible to make rules column based.

mygrid.attachEvent(“onEditCell”,function(stage, id, index,value){
if (stage==2){
switch(index){
case 0: check_first(value); break;
case 1: check_second(value); break;
case 2: check_third(value); break;
}
}
return true;
})

Validators of dataprocessor defined on column base, so there is not problem here as well.

The id and index is used to identify a particular cell in the grid table right? So if i specify just the index which represents the whole column, i can use it to do a particular validation. Am i right?

Any cell in grid can be accessed by knowing rowID and column Index. Most API methods and in-grid events based on such parameters.

>>which represents the whole column, i can use it to do a particular validation
You can itterate through all rows and check necessary column only.
dhtmlx.com/docs/products/dhtmlxG … ingthrough

I think i get it, thanks.