Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Raj on May 15, 2008 23:17
open dhtmlx forum
data validation using dhtml xgrid

Hi,

I am using dhtml xgrid with DataProcessor, I have a problem like I need to check each and every cell after onCellEdit with respect to empty or not empty.
I am getting the data from Database that which column is NULL and which column is NOT NULL. so I would like to add an hidden property/property like nullable to each header column and when onCellEdit I wants to get the value of nullable and do the validation respect to the cell using nullable variable. if condition pass/fail I want to display en alert message.

Can u please help me inthis regard, how to solve this problem?

Is there any function like we are adding column id using setColumnIds(), to do the above one?

/Thanks
Raj
Answer posted by Support on May 16, 2008 02:54

You can store necessary info in userdata sections

<rows>
 <head>
 ...
 </head>
 <userdata name="column_0">null</userdata>
 <userdata name="column_1">not null</userdata>
 ...
 <userdata name="column_N"></userdata>
 
 
mygrid.attachEvent("onEditCell",function(stage, id, ind, value){
 if (stage==2 && mygrid.getUserData("","column_"+ind) && value=="")
  alert("value not valid");
 
 return true;
})