Jul 17, 2012, 9:26 PM
[CLOSED] Button menu is not hiding while mouseout.
Hi,
I have implemented menu in the button and also implemented button listener to show menu. In MouseOver listener the menu is showing and then mouse moves over to the menu, it remains open and if mouseleave from menu, it is hiding. The menu remain open if mouse over the button and leave from button without touching the menu (not move mouse over menu). The example code given below...
If mouseout listener implement on button the menu is hiding while mouse out from button, it is not allowing to access menu.
I have implemented menu in the button and also implemented button listener to show menu. In MouseOver listener the menu is showing and then mouse moves over to the menu, it remains open and if mouseleave from menu, it is hiding. The menu remain open if mouse over the button and leave from button without touching the menu (not move mouse over menu). The example code given below...
If mouseout listener implement on button the menu is hiding while mouse out from button, it is not allowing to access menu.
<script>
var onAfterRender = function (menu, button) {
menu.el.on(
'mouseleave',
function () {
if (!button.lockHideMenu) {
button.hideMenu();
}
},
this,
{
delay: 250
});
menu.el.on(
'mouseenter',
function () {
button.lockHideMenu = true;
(function () {
button.lockHideMenu = false;
}).defer(300);
});
};
</script>
<ext:Button ID="btnNewLoan" runat="server" AnchorHorizontal="right" Text="Start New Loan"
Icon="Add">
<Menu>
<ext:Menu ID="Menu5" runat="server">
<Items>
<ext:MenuItem ID="MenuItem9" runat="server" Text="Start New Loan" Icon="Add">
<DirectEvents>
<Click OnEvent="btnStartNewLoan_Click">
</Click>
</DirectEvents>
</ext:MenuItem>
<ext:MenuItem ID="MenuItem10" runat="server" Text="Import Existing Loan" Icon="PageAttach">
<DirectEvents>
<Click OnEvent="winImportLoanOpen">
</Click>
</DirectEvents>
</ext:MenuItem>
</Items>
<Listeners>
<AfterRender Handler="onAfterRender(this, btnNewLoan);" />
</Listeners>
</ext:Menu>
</Menu>
<Listeners>
<MouseOver Handler="#{btnNewLoan}.showMenu();" />
<%--<MouseOut Handler="onButtonLeave(btnNewLoan);" />--%>
</Listeners>
</ext:Button>
Last edited by Daniil; Jul 25, 2012 at 1:07 AM.
Reason: [CLOSED]