PDA

View Full Version : Problem with List Event Listener



TampaBay55
25 Oct 2012, 10:14 AM
Greetings:

Using ST2, I define a small list using the MVC pattern. When the application runs, all appears to work; however when I atttempt to listen to the "show" event on the grid, nothing happens. The selectionchange event on the grid that works fine....any insight? Thanks

Ext.define('GlsAmCrm.controller.appController',{
extend: 'Ext.app.Controller',
config:{
refs: {},
control: {
'grplist':{
show: function(){
console.log('Grid Has Been Initialized!');
},
selectionchange: function(){
console.log('Changed');
}
}
}
}
});

/**
* GrpData List
**/
Ext.define('GlsAmCrm.view.grpdata.grpList',{
extend: 'Ext.List',
xtype: 'grplist',
config:{
grouped: true,
indexBar: true,
flex: 1,
store: 'grpStore',
itemTpl:'{groupname}'
}
});

mitchellsimoens
27 Oct 2012, 12:28 AM
Usually what I see people doing in the show method could be handled somewhere else. What are you going to be doing in show?

TampaBay55
27 Oct 2012, 4:05 AM
Hey Mitchell:

In EXTJS4 I would use the show event to load the record store for the list and select the first record in the list. I had to use the show event because I wanted to make sure the list was rendered before the selection. Would like to have the same ability in ST2.

TB55