How to tell ExtJS Grid that edited data already synced?
I have few grids on a page. After I edit data in them I press Save button, collect all changes and build Ajax request with changes to server. All works fine, except one thing. After data successfully updated I need to tell grid to redraw and refresh it store, means remove updated / created records from store ( changes displayed as red rectangles in top left corner ).
If I try to remove all records and fill them again I get some ExtJS error: Uncaught TypeError: Cannot read property 'internalId' of undefined callstack:
- Ext.define.updateIndexes ext-all-debug.js:58747
- Ext.define.onAdd ext-all-debug.js:58701
- Base.callParent ext-all-debug.js:2833
- Ext.define.onAdd ext-all-debug.js:76400
- fire ext-all-debug.js:10259
- Ext.define.fireEvent ext-all-debug.js:13385
- Ext.define.insert ext-all-debug.js:44663
- Ext.define.add ext-all-debug.js:44688
- Ext.define.listeners.write OrderEdit.js:560
- fire ext-all-debug.js:10259
- Ext.define.fireEvent ext-all-debug.js:13385
- Ext.define.onProxyWrite ext-all-debug.js:43978
- Ext.define.onBatchOperationComplete ext-all-debug.js:44005
- fire ext-all-debug.js:10259
- Ext.define.fireEvent ext开发者_如何学Go-all-debug.js:13385
- onProxyReturn ext-all-debug.js:51056
- Ext.define.processResponse ext-all-debug.js:26205
- (anonymous function) ext-all-debug.js:26397
- Ext.apply.callback ext-all-debug.js:5022
- Ext.define.onComplete ext-all-debug.js:21028
- Ext.define.onStateChange ext-all-debug.js:20979
- (anonymous function) ext-all-debug.js:1503
Is there any other way to do it correctly ?
to simply redraw the grid and get rid of those red rectangles ... just use commit() function for the records that have been updated or created. This normally should work.
精彩评论