extjs - Store.sync() with new record does not import server-generated fields in response -
i have grid row-editing enabled. when add row , call store.sync(), server generates fields on record, , returns full record info in response. however, extjs not seem update copy of record, except id. there way make that, or need write custom code?
this excerpt of grid's controller:
doneedit: function (editor, e, eopts) { var me = this; // // set loading mask on grid during update (if record changed , 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() used row editor grids // onsavesuccess: function (batch, options) { var me = this, grid = me.getgrid(); grid.getstore().filter([]); // re-run whatever filters exist, , sort. grid.hidemask(); // update read-only active store if specified sub-class if(me.activestore) { // $todo: handle load failure me.activestore.load(); } },
i had same problem (ext 4.2.1). reason forgot set idproperty on reader default "id", mine "_id". ext silently failed update record because didn't recognize matching id. works charm.
so make sure response in correct format expected reader (root, idproperty, model definition, ...)