PDA

View Full Version : Beforeshow not working in panel ?



debabrata
14 Nov 2011, 1:16 AM
I want do something before panel is loaded.So i have given beforeshow event.But it is not working.

var panel = new Ext.Panel({
title: 'Actions',
width:600,
height:300,
bodyStyle: 'padding:10px;',
items: [linechart],
listeners : {
beforeshow : function () {
alert("hi");
}
},

renderTo: 'toolbar'
});



Here alert is not coming.
thanks in advance

darthwes
14 Nov 2011, 7:21 AM
Try beforerender, beforeshow requires you to call show on the panel, and you're not doing that. You could try hooking beforeshow on the toolbar, if the toolbar isn't already shown, but I'd try beforerender on the panel first.

debabrata
14 Nov 2011, 8:47 PM
Thanks a lot darthwes (http://www.sencha.com/forum/member.php?111576-darthwes) .It worked for me. And thanks again for your response.