I have a grid with row-editing enabled. When I add a row and call store.sync(), the server generates certain fields on that record, and returns the full record info in the response. However, ExtJS does not seem to update its copy of the record, except for the id. Is there a way to make it do that, or do I need to write custom code?
This is an excerpt of the grid's controller:
doneEdit: function (editor, e, eOpts) {
var me = this;
//
// Set up loading mask on grid during update (if record changed and is valid)
//
if (e.record.dirty && e.record.isValid()) {
e.grid.showUpdatingMask();
e.store.sync({
success: me.onSaveSuccess,
failure: me.onSaveFailure,
scope: me
});
}
else {
me.cancelEdit(editor, e, eOpts);
}
},
//
// onSaveSuccess() is only used for row editor grids
//
onSaveSuccess: function (batch, options) {
var me = this,
grid = me.getGrid();
grid.getStore().filter([]); // re-run whatever filters already exist, and sort.
grid.hideMask();
// update read-only active store if specified by sub-class
if(me.activeStore) {
// $TODO: handle load failure
me.activeStore.load();
}
},
store.sync()it updates the whole record with the returned data, I'll see if I can spot what the difference is. - egerardus