PDA

View Full Version : Adding new record to “buffered store” in EXTJS



url
3 Dec 2019, 5:59 AM
In my application I've a grid with buffered store.
On click of row of grid, alert will be shown.
I want to add a new row to grid i.e., add a new record to store (should not be saved in back-end until user peforms some save action). The same added record can also be deleted if user chooses to do so.




Currently tried the below approach..



var grid = Ext.ComponentQuery.query('grid')[0],
gridStore= grid.getStore();
var bufferedStoreMap = gridStore.getData().map[currentPage]; //currentPage = 1
var mapVal = bufferedStoreMap.value;

gridStore.totalCount++;
mapVal.unshift(Ext.create('Ext.data.Model',{name:'test'}));
grid.getView().refresh();


With the above code new record is added to store, but grid events like click are not working.
Getting the below error.
58141




Any idea on achieving this??
Any help would be really appreciated.