Jul 06, 2011, 4:51 PM
[CLOSED] dynamically modifying submenu items on the client side
Hi,
We are using ext:Menu where some MenuItems has it's own menu. Some MenuItems on that child menu should be hidden/disabled depending on current node of the parent control (TreePanel). We tried to approach this by adding <Listeners> to first level MenuItem, but there is no OnHover event available there. That event certainly handled by ext.net as SubMenu2 shows while hovering on parent MenuItem1 in the example below, it just not available for us I assume. We tried to use Click event; while it does the job it's too late - SubMenu2 items already rendered before user click on MenuItem1.
How we should handle this situation of dynamically modifying submenu items on the client side?
We are using ext:Menu where some MenuItems has it's own menu. Some MenuItems on that child menu should be hidden/disabled depending on current node of the parent control (TreePanel). We tried to approach this by adding <Listeners> to first level MenuItem, but there is no OnHover event available there. That event certainly handled by ext.net as SubMenu2 shows while hovering on parent MenuItem1 in the example below, it just not available for us I assume. We tried to use Click event; while it does the job it's too late - SubMenu2 items already rendered before user click on MenuItem1.
How we should handle this situation of dynamically modifying submenu items on the client side?
<ext:Menu ID="Menu1" runat="server">
<Items>
<ext:MenuItem ID="MenuItem1" runat="server" Text="Menu1">
<Listeners >
<%-- need something like this
<OnHover Handler ="buildSubMenu()" />
--%>
</Listeners>
<Menu>
<ext:Menu ID="SubMenu2" runat="server">
<Items>
<ext:MenuItem ID="Item1" runat="server" Text="Item1" />
<ext:MenuItem ID="Item2" runat="server" Text="Item2" />
</Items>
</ext:Menu>
</Menu>
</ext:MenuItem>
<ext:MenuItem ID="MenuItem2" runat="server" Text="Menu2">
</ext:MenuItem>
</Items>
</ext:Menu>
Last edited by Daniil; Jul 06, 2011 at 10:48 PM.
Reason: Please use [CODE] tags, [CLOSED]