Inserts a node before another node. This method may also be used to reorder nodes.


nodeData Object

A JSON-formatted string or selector that specifies the node to be inserted.

referenceNode jQuery

The node that follows the inserted node.


jQuery The inserted <li> element, wrapped in a jQuery object.


<div id="treeview"></div>
  dataSource: [
    { text: "foo" }

var treeview = $("#treeview").data("kendoTreeView");
var foo = treeview.findByText("foo");

// insert "bar" before "foo"
treeview.insertBefore({ text: "bar" }, foo);

// move the node "foo" before the node "bar"
treeview.insertBefore(foo, treeview.findByText("bar"));
In this article
Not finding the help you need? Improve this article