This example shows how to use the client-side API of Telerik Menu for ASP.NET MVC.
To use the client-side API you should first retrieve the menu client-side object.
The following code snippet shows how to do this:
<script type="text/javascript">
function getMenu(){
//"Menu" is the value specified by the Name() method.
var menu = $("#Menu").data("tMenu");
return menu;
}
</script>
Available client-side methods:
-
You can open a menu item with the open(...) method. This method accepts a DOM element representing an existing
menu item, a collection of DOM elements or a jQuery selector.
-
You can close an item with the close(...) method. This method accepts a DOM element representing an existing
menu item, a collection of DOM elements or a jQuery selector.
-
You can enable an item with the enable(...). This method accepts a DOM element representing an existing
menu item, a collection of DOM elements or a jQuery selector.
-
You can disable an item with the disable(...) method. This method accepts a DOM element representing an existing
menu item, a collection of DOM elements or a jQuery selector.