I am binding ExtJs Gridpanel from database and add \"Delete\" button below my gridpanel. By using the delete button handler, I have deleted selected record on gridpanel. But
try this grid.getView().refresh();
Another approach in 3.4 (don't know if this is proper Ext): You can have a delete handler like this, assuming every row has a 'delete' button.
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var id = rec.get('id');
// some DELETE/GET ajax callback here...
// pass in 'id' var or some key
// inside success
grid.getStore().removeAt(rowIndex);
}
Try refreshing the view:
Ext.getCmp('yourGridId').getView().refresh();
reload the ds to refresh grid.
ds.reload();
grid.getStore().reload({
callback: function(){
grid.getView().refresh();
}
});
I had a similiar problem. All I needed to do was type store.load();
in the delete handler. There was no need to subsequently type grid.getView().refresh();
.
Instead of all this you can also type store.remove(record)
in the delete handler; - this ensures that the deleted record no longer shows on the grid.