Jan 31, 2015, 7:44 PM
[CLOSED] Need Menuitemclick on clientside
Hi, I'm trying to have a button with menuitems , and for each click of the menuitems, fire a javascript to load an app, like the
Instead of having the treemenu of the examples, I want to have a menu(buttons with menuitems) in the upper side.
this is the javascript, yes it is not working:
Instead of having the treemenu of the examples, I want to have a menu(buttons with menuitems) in the upper side.
this is the javascript, yes it is not working:
var onMenuItemClick = function (mi,e) { /*which parameters are passed to the function?*/
e.stopEvent(); /*?*/
loadApp(mi.get('href'), mi.getId(), mi.get('text'));
};
var loadApp = function (href, id, title) {
var tab = App.tbApps.getComponent(id),
lObj = lookup[href];
if (id == "-") {
App.direct.GetHashCode(href, {
success: function (result) {
loadApp(href, "e" + result, title);
}
});
return;
}
lookup[href] = id;
and this the .aspx code, here is where I need help for coding the javascript calls for each menuitemclick: <ext:Toolbar runat="server" Flat="true">
<Items>
<ext:Button ID="aa" runat="server" Text="Admin" Icon="User" Scale="Medium" Visible="false">
<Menu>
<ext:Menu runat="server">
<Listeners>
<Click Handler="onMenuItemClick();" /> /* Where does this javascript call need to be placed? */
</Listeners>
<Items>
<ext:MenuItem runat="server" Text="Users" Icon="GroupAdd" ID="aa000" Href="U.aspx" />
<ext:MenuItem runat="server" Text="Audits" Icon="GroupDelete" ID="aa001" Href="A.aspx"/>
<ext:MenuItem runat="server" Text="AppConfig" Icon="GroupEdit" ID="aa002" Href="S.aspx"/>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
Thanks in advance.
Last edited by fabricio.murta; Feb 01, 2015 at 2:48 PM.
Reason: [CLOSED]