This question is locked. New answers and comments are not allowed.
I am developing extensions to the client API for the Telerik MVC controls and wanted to share the latest extension function. I have added a function to the TreeView to add context menus to a TreeView that can be configured to be displayed depending on the node that is selected. The code and sample applications for RAZOR and ASPX can be found at:
http://www.aspnetwiki.com/telerik-mvc:adding-a-context-menu-to-the-treeview
Here is an example of adding two context menus, one for a "project" node and one for a "code file" node:
Please share with me any feedback that you have! =)
Regards,
John DeVight
http://www.aspnetwiki.com/telerik-mvc:adding-a-context-menu-to-the-treeview
Here is an example of adding two context menus, one for a "project" node and one for a "code file" node:
Layout.NavigationTreeView_OnLoad = function(e) { $('#NavigationTreeView').data('tTreeView').addContextMenu({ evaluateNode: function(treeview, node) { var nodeValue = treeview.getItemValue(node); var nodeType = nodeValue.split('|')[0].toString(); return nodeType == 'project'; }, menuItems: [{ text: 'Properties', onclick: Layout.NavigationTreeView_OnProperties }] }); $('#NavigationTreeView').data('tTreeView').addContextMenu({ evaluateNode: function(treeview, node) { var nodeValue = treeview.getItemValue(node); var nodeType = nodeValue.split('|')[0].toString(); return nodeType == 'codefile'; }, menuItems: [{ text: 'Edit', onclick: Layout.NavigationTreeView_OnEdit }, { text: 'Delete', onclick: Layout.NavigationTreeView_OnDelete }, { separator: true }, { text: 'Properties', onclick: Layout.NavigationTreeView_OnProperties }] });}Please share with me any feedback that you have! =)
Regards,
John DeVight