C1Menu

Posted by: sbarnes on 10 September 2017, 11:51 am EST

  • Posted 10 September 2017, 11:51 am EST

    On mouse click I would like to call a JavaScript function as well as have the menu item work as a normal link... yet I can't seem to find any reference to OnClientClick ( Such as in MS Controls and Infragistics Controls )in the menu or it's items. Is what I am attempting to do possible?
  • Replied 10 September 2017, 11:51 am EST

    Hello,

    You can handle OnClientSelect method and can call your javascript method from it.

    If it does not work, then kindly post a small sample reproducing the issue so that I can assist you accordingly.

    Regards
  • Replied 10 September 2017, 11:51 am EST

    Hey Ashish, when I set the OnClientSelect, it runs the client side scripting OnLoad... instead of "OnSelect". Code samples below:

    ASP Code Sample
    ------------------------
     <wijmo:C1Menu ID="mnuAdmin" runat="server" Height="25px" Width="110px" OnClientSelect="pleaseWait()">
    <Animation Option=""></Animation>
    <ShowAnimation Option=""></ShowAnimation>
    <HideAnimation Option="">
    <Animated Effect="fade" />
    </HideAnimation>
    <Items>
    <wijmo:C1MenuItem runat="server" Text="Administration">
    <Items>
    <wijmo:C1MenuItem runat="server" StaticKey="sk1" Target="iframeContent" Text="Manage Users"></wijmo:C1MenuItem>
    <wijmo:C1MenuItem runat="server" StaticKey="sk2" Target="iframeContent"
    Text="Manage Companies"></wijmo:C1MenuItem>
    <wijmo:C1MenuItem runat="server" StaticKey="sk3" Target="iframeContent"
    Text="Org Mapping Config"></wijmo:C1MenuItem>
    </Items>
    </wijmo:C1MenuItem>
    </Items>
    </wijmo:C1Menu>

    <div id="divWaiting" runat="server" class="wijmo-wijev-loading" style="display: none" />





    JQuery
    -------------------

    function pleaseWait() {
    form1.className = 'ui-state-disabled';
    document.getElementById('divWaiting').style.display = 'block';
    }



    This has been confirmed by multiple developers in the office, anything out in "OnClientSelect" is treated as "OnLoad".
  • Replied 10 September 2017, 11:51 am EST

    We found the problem with the control..

    OnClientSelect="pleaseWait()"

    The above code forces the menu to execute "pleaseWait()" on control load.


    OnClientSelect="pleaseWait"

    The above code currently executes only "OnClientSelect".
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels