rvini2006
12 Aug 2011, 3:49 AM
Hi
We are using Extjs 4 for our application development. We are trying to implement dynamic controller loading. (http://www.sencha.com/forum/showthread.php?132795-Dynamically-loading-MVC-controller) For this to work we need to have the menu's selection events captured in our controller. In our current design we are using the 'handler' to capture the menu click event. But we would want to change the design to have a view where we define our menu details, the selection event menu items need to be captured with in the controller. Any tips/ suggestion will of great help. Thanks in advance.
Currently our implementation is
Ext.define('App.view.layout.AppMenu', {
extend : 'Ext.menu.Menu',
alias : 'widget.AppMenu',
layout : 'fit',
plain : true,
floating : false, // usually you want this set to True (default)
renderTo : Ext.getBody(), // usually rendered by it's containing component
items : [ {
text : 'Users',
handler : onItemClick,
iconCls : 'user_info_icon',
}, {
text : 'Managers'
}
});
function onItemClick() {
// steps based on the menu items selected...
}
We are using Extjs 4 for our application development. We are trying to implement dynamic controller loading. (http://www.sencha.com/forum/showthread.php?132795-Dynamically-loading-MVC-controller) For this to work we need to have the menu's selection events captured in our controller. In our current design we are using the 'handler' to capture the menu click event. But we would want to change the design to have a view where we define our menu details, the selection event menu items need to be captured with in the controller. Any tips/ suggestion will of great help. Thanks in advance.
Currently our implementation is
Ext.define('App.view.layout.AppMenu', {
extend : 'Ext.menu.Menu',
alias : 'widget.AppMenu',
layout : 'fit',
plain : true,
floating : false, // usually you want this set to True (default)
renderTo : Ext.getBody(), // usually rendered by it's containing component
items : [ {
text : 'Users',
handler : onItemClick,
iconCls : 'user_info_icon',
}, {
text : 'Managers'
}
});
function onItemClick() {
// steps based on the menu items selected...
}