Conditional Menu enable

5 posts, 1 answers
  1. Man
    Man avatar
    48 posts
    Member since:
    Sep 2015

    Posted 01 Oct 2015 Link to this post

    Hi,

    I am trying to build a portal where the application has several forms for a employee

    The user will get access to the various forms using the menu items. 

     

    All the menu items are disabled on application load and user is shown a search page

    When the user successfully searches for an employee, they will be able to access all the forms for that employee

     

    Can you please advise how I can dynamically enable the menu items (only when user has searched and selected an employee)

    Also, all the data is employee id dependent so the index actions will always need the id to load the relevant data for that page.

    Can you please advise how to acheive this 

     

     

     

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 02 Oct 2015 Link to this post

    Hi,

    Check out the following dojo example that illustrates how you can enable a menu item manually.



    Regards,
    Viktor Tachev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Man
    Man avatar
    48 posts
    Member since:
    Sep 2015

    Posted 04 Oct 2015 in reply to Viktor Tachev Link to this post

    Hi Viktor,

       My menu item is on the layout view and i am trying to enable and disable this using my partial view. Hence, it cant seem to find the item. from the layout view

  5. Answer
    Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 06 Oct 2015 Link to this post

    Hello,

    You can use an approach similar to the one in the following online example to locate the menu item.


    Also check out a simplified version of the JavaScript code for activating the second menu item below:

    function enableMenu() {
        var menu = $("#Menu").data("kendoMenu");
        var secondItem = menu.element.children("li").eq(1);
     
        menu.enable(secondItem, true);
    }


    Regards,
    Viktor Tachev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Man
    Man avatar
    48 posts
    Member since:
    Sep 2015

    Posted 08 Oct 2015 in reply to Viktor Tachev Link to this post

    That worked. Thanks
Back to Top
Kendo UI is VS 2017 Ready