I have a question regarding the show event.
in my application I’m handling the painted event of my panel like this:
Ext.define('mvcTest.controller.Test', {
extend: 'Ext.app.Controller',
config: {
refs: {
panel: '#testpanel'
},
control:{
panel: {
painted: 'onPainted'
}
}
},
onPainted: function(){
alert('painted');
}
});
the docu say’s, that there is also a “show” event, but it get not fired at all:
Ext.define('mvcTest.controller.Test', {
extend: 'Ext.app.Controller',
config: {
refs: {
panel: '#testpanel'
},
control:{
panel: {
show: 'onShow'
}
}
},
onShow: function(comp, obj){
alert('show');
}
});
why this does not work?
i know, alerting is the wrong way, but that’s not the question.
thanks,
mike
It seems that there’s no mistake in your controller. The key reason may lie in another part of your application but … ok, according to my experience:
paintedevent straight-forward. Everytime your view is really rendered on the screen,paintedfired up. (Note:paintedevent fires BEFORE the child components of your view are totally rendered. In another word,paintedfirst, DOM generation second.)showevent does NOT necessarily fire up, especially for the initialization time of your view.showevent is something fired up when you firstly somehow hide your view, and show it later.Just experience, may be variant. But hope it might be helpful for you.