Categories | Question details Back To List | ||
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"?> <rows> <row id="123"> <cell type="ro">456</cell> <cell type="ed">abc</cell> <cell type="ed">abc</cell> <cell type="ro">abc</cell> </row> </rows> Best regards Bernard Answer posted by Support on Mar 30, 2009 06:09 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. Answer posted on Mar 30, 2009 07:57 Thank you very much for this fast help! It works fine! Best regards Bernard |