Getting dataProcessorto respond to Undo/Redo

I have a grid which loads dynamically through a PHP script. I also have the dataProcessor set up to do updates (and soon adds/deletes) to the server.



What I need now is to find out how to get the .doUndo and .doRedo functions to fire off updates to the server as well. Right now you can go in and edit a field and hit Undo, but if you refresh the grid the change is still there.



Any ideas?

There is no built in support of such functionality , but code can be easily updated in necessary way.

dhtmlxgrid_undo.js

dhtmlXGridObject.prototype.doUndo = function()
{
        …
        c.setValue(obj.old_value);
        this.callEvent(“onEditCell”,[2, obj.row_id, obj.cell_index]);  //this line need to be added
}


added line will generate onEditCell event while undo call, which will trigger dataprocessor in default way.

I assume that you’d add the same line of code to doRedo at the very end to accomplish the same result with Redo’s, correct?

I assume that you’d add the same line of code to doRedo at the very end to accomplish the same result with Redo’s, correct?
yes, it can be done in same way for redo functionality.