Refresh only one row in dhtmlxGrid

Hi there,



I am using dhtmlxGrid (v.1.6 build 80603) with the dhtmlxdataprocessor.js (v.1.0 build 80512).



Is there any posibility to update only one row after editing a cell?



I am using



myDataProcessor.setOnAfterUpdate(myUpdate);



function myUpdate(){

mygrid.updateFromXML(“URL”);

}



The problem is, that the updateFromXML-request for the URL takes about 5 seconds, because there are many rows in the sql-table. So at this time I have to wait after every cell edit before I can continue editing.



I need to something like this:



function myUpdate(){

mygrid.updateFromXML(“URL?rid=123&id=456”);

}



Only the row id (rid=123) should be updated.

If I have the primary key id, I can start a sql request for only one row with the this id.

It would generate following XML and hopefully only update this one row?!?



<?xml version="1.0" encoding="UTF-8"?>





456

abc

abc

abc







Best regards

Bernard

Instead of setOnAfterUpdate, you can use

myDataProcessor.defineAction(“update”,myUpdate); //update here related to action@type in xml response for edit operation
function myUpdate(tag){
mygrid.updateFromXML(“URL?for=”+tag.getAttribute(“sid”));
return true;
}


In such case update will be called after response for edit operation received, and will provide ID of updated row as parameter
Actually you can extend the code which sends XML response for dataprocessor, and include new cell value as some attribute , in such case you would be able to update data ( by grid.cells ) directly from myUpdate method, without need to call server one more time.




Thank you very much for this fast help!



It works fine!



Best regards



Bernard