Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Dhafir on Jan 28, 2008 18:31
open dhtmlx forum
How to update an existing row with one call?

Hi,
I know we can update a grid cell by going grid.cell(rowId,ColIndex).setValue( newValue); But if we need to update all cells in a row this method is slow and not practical. I tries calling grid.loadXMLString( rowXML) passing the same rowId but it ended up add the row and not updating the existing one.

Is there a better way to update the entire row?

Thanks
Dhafir @ Honad
Answer posted by Support on Jan 29, 2008 01:37
There is an inner method, which can be used for it
    grid._fillRow(grid.getRowById(ID),data);
where data - array, or comma separated string of values

>> all cells in a row this method is slow and not practica
Actually, while it may look complex, this method is not so slow, to simplify code you can use
    var data=[.....]
    grid.forEachCell(ID,function(c,i){
       c.setValue(data[i]);
    });