In the kendo ui menu, we need the ability to associated a number (or primary key) with the menu so that when it is clicked we can then use this id and make an async js callback or the like. At the moment the only thing we have available is the menu item text. What happens if the menu has two menu items with the same text? ie File -> Properties and Folder -> Properties?
Hello David,
You can set the id attribute in the li elements of the ul the Menu is initialized from:
<ul id="menu">
<li id="Item1">Item 1
<ul>
<li>Sub Item 1</li>
<li>Sub Item 2</li>
<li>Sub Item 3</li>
</ul>
</li>
<li>Item 2
<ul>
<li>Sub Item 1</li>
<li>Sub Item 2</li>
<li>Sub Item 3</li>
</ul>
</li>
</ul>
<script>
$("#menu").kendoMenu();
// get a reference to the menu widget
var menu = $("#menu").data("kendoMenu");
// open the sub menu of "Item1"
menu.open("#Item1");
</script>
In scenarios where the Menu uses a dataSource, item ids can be set through the attr configuration option:
attr: {
id: "item1"
}
This seems to cover the requested functionality, so we are closing this feature request.
Regards,
Ivan Danchev
Progress Telerik