This is a migrated thread and some comments may be shown as answers.

Conditional Menu enable

4 Answers 290 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Man
Top achievements
Rank 1
Man asked on 01 Oct 2015, 03:54 PM

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 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 02 Oct 2015, 02:51 PM
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!
 
0
Man
Top achievements
Rank 1
answered on 04 Oct 2015, 06:32 PM

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

0
Accepted
Viktor Tachev
Telerik team
answered on 06 Oct 2015, 11:54 AM
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!
 
0
Man
Top achievements
Rank 1
answered on 08 Oct 2015, 09:40 AM
That worked. Thanks
Tags
Menu
Asked by
Man
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Man
Top achievements
Rank 1
Share this question
or