PDA

View Full Version : RowEditor question: how to refresh row data before editing & after saving ?



fededim
5 Oct 2010, 4:58 AM
Hi,

I am using a gridpanel with a roweditor plugin and I need to:

- Refresh the row data of the row being edited with the database just before switching into "editing mode".
(This is needed since the table data is modified by multiple users at the same time and we need the user to see the changes done by other users meanwhile)

- Refresh the row data of the row edited (i.e. after the user has confirmed his/her modifications) just before exiting the "editing mode"
(As previous point this is needed since some values of the row could have been updated meanwhile by other users and I would like to update the grid with these new values)

What is the best way to do this ?

Federico.

Condor
5 Oct 2010, 5:17 AM
1. Write a beforeedit event handler for the roweditor that does the server request to get the new record data and return false.
2. When the new record data is received, update the record and call roweditor.startEditing again (use a flag to not go into step 1 again).
3. Write a validateedit event handler for the roweditor that shows the confirmation dialog and return false.
4. In the messagebox handler (when OK/Yes is pressed) call rowEditor.stopEditing again (use a flag to not go into step 3 again).