Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Jan 24, 2008 13:06
open dhtmlx forum
dhtmlxgrid

iam currently using the grid in one of my projects and i need to perform cell validation. I was looking at your dataprocessor sample and i understand how you validate numericacl fields like price. Right now these validations are being performed as soon as i click the add new row link. Say if i have a calendar and string cell types how would i validate these fields show appropriate messages?? Please provide me with some samples
Answer posted by Support on Jan 25, 2008 02:41
Are you need validation as part of dataprocessor saving routine, or separate validation functinality ?
In second case you can create a custom validation without usage of dataProcessor


grid.attachEvent("onEditCell",function(stage,id,ind,value){
    if (stage == 2 && ind == INDEX ){
          //expect the date in format mm/dd/yyyy
          var parts=value.split("/")
          if (parts[0]>12) {   //any kind of check here
                alert("Incorrect date");
                return false; //block result of edit operation
          }
    }
    return true;
})


INDEX - index of column , for which validation is necessary