I'm deleting a row in a grid by getting its id and call a rest web service to delete it from database. The data grid is updated by the call of store.load(); The issue is that the record count never change unless I refresh the pages.
success : function (response) {
console.log("count before load" + pDetailsTab.tvsListGrid.store.getCount());
pDetailsTab.tvsListGrid.store.load();
console.log("count after load " + pDetailsTab.tvsListGrid.store.getCount());
if (pDetailsTab.tvsListGrid.store.getCount() >= 1) {
console.log("inside if");
pDetailsTab.tvsListGrid.getSelectionModel().select(0);
} else if (pDetailsTab.respSGrid.store.getCount() >= 1) {
pDetailsTab.respSGrid.getSelectionModel().select(0);
}
ExtjsUtils.hideWait();
}
Here is the output of console.log (I have replaced some output with '...'):
count before reload 1 ...
...
count after reload 1 ...
I've searched the internet but in vain. Any idea please?