I have an ExtJS editor grid which has some columns inside. I want to modify data on a record and auto save data to DB. But I just need save data after I complete editing all cells at the current row. I've used the event "afteredit" but it fired the event right after one cell was changed. How can I keep that event not to fire until I've completed modifying all cells? Or could you please suggest another way to do this, not use the "afteredit" event? Thank you so much.
相关问题
- Stop child process when parent process stops
- Fire resize event once not based on timing
- Tkinter Grid Columnspan ignored
- C# CS0079 Event Handling Compile Errors
- Google Maps event listeners not working properly i
相关文章
- What does it means in C# : using -= operator by ev
- How are custom broadcast events implemented in Jav
- Programming a touch screen application with SWING
- Sencha Ext.define Uses vs Requires
- How many pixels are scrolled on a website with a m
- Difference Between RoutedEventHandler and EventHan
- Wait for function till user stops typing
- WPF- validation error event doesn't fire
When edit event has been fired, you should check modified config to check whether all of grid columns have been modified or not. After modifying, you can send them to your back end.
Here is my question back: Do you edit all the cells in a row? A better solution would be to use a "save" button to send the updated data back to the server and save it into DB.
Now, if you insist that all cells at a row will be modified, you can do the following:
In
afteredit
event handler:event.record
)modified
.I think in your case it would be easier to have a button that you click to save the grid. you could access all the modified records by calling
grid.store.getModifiedRecords()
and send that to your backend service and do a mass update instead of updating a single row at a time.You could use the
rowdeselect
event on the selection model (assuming that you use aExt.grid.RowSelectionModel
. Inside the event handler you can check if the record has been modified and react accordingly.You might take a look at
Ext.ux.grid.RowEditor
. It has anafteredit
event that fires when the row is done being edited.You can find the working example at http://dev.sencha.com/deploy/dev/examples/grid/row-editor.html