Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by patricia on Sep 01, 2008 01:00
open dhtmlx forum
Add row when last row is not empty

Please I need to add row to grid just when the last row is not empty.
i don't want to let the user add undefined rows when the row before is empty.
thank you
Answer posted by Support on Sep 01, 2008 02:02

function clever_add(){
     var last = grid.getRowsNum()-1;
     if (grid.cells2(last,0).getValue()=="") return;

     grid.addRow(....);

}

the code above check cell in last row , and skip addRow command when cell in last row is empty