Magnus Reuter
Magnus Reuter

Reputation: 1

ExtJS Grid selection not refreshing after store update

I have a grid with 2 rows, when removing the first row from the store the grid updates and looks as expected. But the old selection is still active with data that should not exist anymore.

When doubleclicking (the new first row) in the grid, it opens the old data.

After updating the store I have tried:

grid.getSelectionModel().select(0);
grid.getSelectionModel().deselectAll();
grid.getSelectionModel().clearSelections();

This is ExtJS version 6.5, classic

Upvotes: 0

Views: 177

Answers (1)

Ali Tooshmalani
Ali Tooshmalani

Reputation: 260

you can use bind in grid. like

Ext.create('Ext.panel.Grid',{
     bind:{
           selection: '{selection}'
},
.....codes    })

    Ext.create('Ext.app.ViewModel',{
alias: 'viewmodel.aliasname',
data:{selection: null}})

now update or reload store selection is null.

Upvotes: 0

Related Questions