PDA

View Full Version : Destroy a panel not working



samseena
21 Nov 2012, 1:16 AM
I am having a functionality like I have a panel appearing like a pop-up and then on click of a radio button I need to have some actions to be done and then destroy the panel. But its not working :(
itemselected: function (btn) {var form = btn.up('panel');
form.destroy();
},

I have defined "btn" earlier - var btn = Ext.fly('text_'+key_value);

The same methods" var form = btn.up('panel');
form.destroy(); "
will work if I have a button and have it inside the "tap" function.
This works.
eg.
tap: function (btn) {
var form = btn.up('panel');
form.destroy();
}

I wonder why it doesn't work when its called inside "itemselected" event. Please help if you have any clue on this.

mitchellsimoens
23 Nov 2012, 7:21 AM
itemselected event on what?