Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Shilpi on Feb 20, 2008 14:22
open dhtmlx forum
DataProcessor - setUpdateMode function

I have two questions:

1) I use a dataProcessor with a grid to keep track of changes. We provide two buttons to the user to save all changes and to discard changes. In the 'Save' handler I call sendData() method of the dataProcessor which works fine but how should I implement the 'Clear changes? Is there a way to empty the list of changes within the dataprocessor and display the grid again as earlier?

2) We call setUpdateMode('off'); for our grid dataProcessor before calling the init() function. Can we call this function again later to change the update mode to say 'row' or 'cell' and do some operations and then switch back to 'off' mode?
Answer posted by Support on Feb 21, 2008 10:11
>>but how should I implement the 'Clear changes

It possible to clear updated states of rows, by
    dataproc.updatedRows=[];
But there is no way to fully restore previous state of grid , if you need to restore only changed values ( not row adding|deleting ) you can try to use "undo" extension which can undo edit operations.
Basically most simple way to restore grid - reload it back from server
    grid.clearAll();
    grid.loadXML(original_url)

>> Can we call this function again later to change the update mode
sure, the update mode can be changed in any time.