Categories | Question details Back To List | ||
dhtmlxgrid - addrow & new DB id Hi , I am using a dhtmlxgrid with mysql as a backend DB. The response from the server contains the new ID that was created as autoincrement. The problem starts with commands that need to be executed right after adding a new row (e.g addRow & copyRowValues) - since it's async, the id of the new added row has a different ID until the response is received and the delay is causing a lot of troubles in my application. This piece of code doesn't work either, since it passes a wrong rid myDataProcessor.setOnBeforeUpdateHandler(function(rid){ bar= document.getElementById("progress"); bar.innerHTML="Saving data, please wait..."; mygrid.lockRow(rid,true); return true; }); myDataProcessor.setOnAfterUpdate(function(rid){ mygrid.lockRow(rid,false); bar= document.getElementById("progress"); bar.innerHTML=""; return true; } The build i am using is v.1.6 build 80512 I need to make sure that the next command after addRow is executed only after the new row was added and the response was received. Can you please help? Thanks in advance Gabriel Answer posted by Support on Apr 08, 2009 05:15 code attached to setOnAfterUpdate event receives not only initial row id value, but new ID as well myDataProcessor.setOnAfterUpdate(function(sid,action,tid){ //tid - new ID for insert operation |