ExtJs Gridpanel store refresh

后端 未结 10 1277
刺人心
刺人心 2020-12-28 14:08

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

10条回答
  •  无人及你
    2020-12-28 14:14

    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);
    }
    

提交回复
热议问题