Greetings all:

Using 5.0.1255 build 1189 gpl


Seems like a bunch of stuff that worked in 4.2 are broken in 5. Could also be that I am not implementing them correctly but here goes. I have a grid panel with the following controller:



Code:



Ext.define('WebApp.view.admin.pradata.PraDataGridController',{
extend: 'Ext.app.ViewController',
alias: 'controller.pradatagrid',
control: {
'#':{
'afterrender': 'onGridShow'
}
},
onGridShow: function(){
me = this;
this.getViewModel().getStore('pradatastore').load({
callback: function(){
console.log(this.getCount()); //Console Log Shows 1
if(this.getCount() > 0)
me.getView().getSelectionModel().select(0);
}
});
}
});

Essentially I want to select the first record in the grid if there are records in the store; however, this snippet of code does not work. Is there another approach I am supposed to be taking? Thanks!!