findByUid

Searches for a node with the given unique identifier. Applicable when the widget is bound to a HierarchicalDataSource. If you want to find a node by its id, use the dataSource.get() method and supply its uid to the findByUid method.

Parameters

uid String

The uid that is being searched for.

Returns

jQuery The found node, wrapped in jQuery object.

Example

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

var treeview = $("#treeview").data("kendoTreeView");
var barDataItem = treeview.dataSource.get(2);
var barElement = treeview.findByUid(barDataItem.uid);
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(barElement);
</script>
In this article