I use a grid with a RowEditor to read, update, create and destroy record.
Records are correctly inserted, updated and read from/to the server and are correctly displayed in the grid (one can modify inserted records or delete them).
However if a record is created and thereafter saved (calling store.save()) then if one selects it then such row can't be deselected any longer; so that record remains in a select state.
For inserted record the id property is correctly set and phantom, dirty are set to false.
The inserting row code is:
Code:
var store = lgrid.getStore();
var rt = store.recordType;
var r = new rt(lgrid.newRecord);
lgrid.initialConfig.plugins[lgrid.rowEditorPluginIdx].stopEditing();
store.insert(0, r);
lgrid.getView().refresh();
lgrid.getSelectionModel().selectRow(0);
lgrid.initialConfig.plugins[lgrid.rowEditorPluginIdx].startEditing(0);
when the user confirm changes (presses 'Update' button) it calls the function below:
Code:
'afteredit': function(me, changes, record, rowIndex) {
me.grid.getStore().save();
}
So, is there anything wrong with handling new records like above or is that a bug?
regards