Telerik Extensions for ASP.NET MVC

Version Q2 2012, released 06/07/2012

Client-side API

  • UI Components
    • ASP.NET WebForms
    • Silverlight
    • ASP.NET MVC
    • WinForms
    • WPF
  • Data
  • TFS Tools
  • Automated Testing
  • ASP.NET CMS

Client API

/
/
/
/ / /
/

About this example ASPXRazor

This example shows how to use the client-side API of Telerik TreeView for ASP.NET MVC.

To use the client-side API you should first retrieve the treeview client-side object. The following code snippet shows how to do this:

<script type="text/javascript">
function getTreeView(){
    //"TreeView" is the value specified by the Name() method.
    var treeview = $("#TreeView").data("tTreeView");
    return treeview;
}
</script>

The available client-side methods are:

  • treeview.expand(node) - expands a treeview node.
  • treeview.collapse(node) - collapses a treeview node.
  • treeview.enable(node) - enables a treeview node.
  • treeview.disable(node) - disables a treeview node.
  • treeview.getItemText(node) - gets the text of a treeview node.
  • treeview.getItemValue(node) - gets the value of a treeview node. If the value is not set, returns the node text.
  • treeview.nodeCheck(node, isChecked) - checks/unchecks a treeview node that has a checkbox, depending on the value of isChecked.
  • treeview.append(node, referenceNode) - appends a new node or moves an existing one to referenceNode.
  • treeview.insertBefore(node, referenceNode) - inserts a new node or moves an existing one before referenceNode.
  • treeview.insertAfter(node, referenceNode) - inserts a new node or moves an existing one after referenceNode.

All of the above methods accept node as either a DOM element, jQuery selector or a jQuery object.

For more information, refer to the client API documentation.

Interested in HTML5 and mobile-powered ASP.NET MVC apps?

Experience the next generation UI and framework for ASP.NET MVC development by downloading trial evaluation copy of Kendo UI Complete for ASP.NET MVC. Jumpstart your development with the available learning resources.

The differences between Telerik MVC Extensions and Kendo UI Complete for ASP.NET MVC, and their licensing models are explained here and here.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Other Demos: