Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by souma on Aug 05, 2008 07:06
open dhtmlx forum
validation

hi team
tahnks a lot for the previous answer i want to chek if all the fields in edited by the user in the data grid have a value (non empty) before saving in the dada base
what type of code can i add in my following js fuction :
function sendData ()
{myDataProcessor.sendData();}
please help me
thanks
Answer posted by Support on Aug 05, 2008 08:11

You can 

a) use built in verificatiors 
http://dhtmlx.com/docs/products/dhtmlxGrid/samples/dataprocessor/savedata_grid.html?un=1217950168000

  //verify if the value of 2nd column (zero-based numbering is 1) is not empty
  myDataProcessor.setVerificator(1)


b) use custom code as

var ids=mygrid.getChangedRows().split(",");
for (var i=0; o<ids.length; i++) 
        mygrid.forEachCell(ids[i],function(c,index){
                  if (!c.getValue()) alert("empty cell");
       }