PDA

View Full Version : How to display panel on click event of menu?



shekhar.kotekar
24 Apr 2012, 1:12 AM
Hi,

I would like to know how to display certain panel on click event of menu? I have added menu items in viewport and listening for 'click' event of menu items in controller. Upto this point its working fine but when I use Ext.widget() method to get panel and call show() method of that panel, nothing is happening.

My code to handle menu item click event is as follows :


viewPortMenu_ClickHandler : function(menu, item, event, options) {
var panelToShow = null;
if (item.text == '4D view') {
panelToShow = Ext.widget('employeeDistribution');
}
if (panelToShow != null) {
panelToShow.show();
}
}

Please let me know why this is not working / what is the preferred way to display panels at runtime?

shekhar.kotekar
24 Apr 2012, 1:33 AM
I found the answer. I just had to add the newly created panel inside viewport using add() method of viewport.