Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Re-selecting row after store.load()

Tags:

grid

extjs

extjs4

I have grid panel and a button.
when i click button it will transfer data via ajax and after finish grid will reload.
I try to re-selected row (in here i give u example is first row), but anyway it's not working

Ext.Ajax.request({
    url: ...,
    params: {
        v: ...                  
    },
    success: function(response){
        grid.store.load();                                            
        grid.getSelectionModel().select(0, true); // example first row

    }
})  
like image 331
DeLe Avatar asked Jun 10 '13 08:06

DeLe


1 Answers

try selecting row in callback

grid.store.load({
  scope:this,
  callback:function(records, operation, success){
     grid.getSelectionModel().select(0, true); 
  }
});

or

grid.store.load(function(records, operation, success){
  grid.getSelectionModel().select(0, true); 
});
like image 84
MMT Avatar answered Nov 15 '22 10:11

MMT