New to Kendo UI for jQueryStart a free 30-day trial

Append

methods

Appends a node to any level of the TreeView . This method may also be used to reorder nodes.

Parameters:nodeDataObject|jQuery

A JSON-formatted string or selector that specifies the node to be appended. If the argument is a plain JavaScript object, a new item will be created. If the argument is a jQuery element that holds a node, the TreeView node will be moved. If the argument is an array of objects, each item of the array will be appended.

Returns:jQuery

The inserted <li> element, wrapped in a jQuery object, or null if the new model has not been inserted immediately.

<div id="treeview"></div>
<script>
$("#treeview").kendoTreeView({
  dataSource: [
    { text: "foo" }
  ]
});

var treeview = $("#treeview").data("kendoTreeView");
// appends a new node to the root level
treeview.append({ text: "bar" });

// appends a new node to the first treeview item
treeview.append({ text: "baz" }, $("#treeview .k-item:first"));

// move the item with text "bar" within the item with text "foo"
treeview.append(treeview.findByText("bar"), treeview.findByText("foo"));

// append two items to the root level
treeview.append([
  { text: "qux" },
  { text: "cat" }
]);
</script>
Not finding the help you need?
Contact Support