Nov 17, 2020, 2:52 PM
[CLOSED] Delete new record in GridPanel
Hi
I have problem deleting newly added rows in a GridPanel. It works great to add row and the delete works if I manually click the row then delete it.
But it does not work by clicking the "Delete" button directly after adding the row.
The problem is that for some reason the
Add new row
Mikael
I have problem deleting newly added rows in a GridPanel. It works great to add row and the delete works if I manually click the row then delete it.
But it does not work by clicking the "Delete" button directly after adding the row.
The problem is that for some reason the
var selection = App.gpPriser.getSelectionModel().getSelection()[0];
returns undefined. Any ideas of why this happens?Add new row
var row = store.indexOf(store.insert(0, {})[0]);
Ext.defer(function () {
grid.editingPlugin.startEditByPosition({ row: row, column: 0 });
}, 100);
Delete buttonvar selection = App.gpPriser.getSelectionModel().getSelection()[0];
if (selection) {
App.gpPriser.store.remove(selection);
App.btnSparaPrisrad.fireEvent(App.btnSparaPrisrad.clickEvent); //sparar store, dvs raderar de rader som ska raderas mot databas
}
Best regardsMikael
Last edited by fabricio.murta; Nov 20, 2020 at 10:07 PM.