Edit this page

dataItem

Returns the data item to which the specified node is bound.

Parameters

node jQuery |Element |String

A string, DOM element or jQuery object which represents the node. A string is treated as a jQuery selector.

Returns

kendo.data.Node The model of the item that was passed as a parameter.

Example - get the data item of the first node

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

var treeview = $("#treeview").data("kendoTreeView");
var dataItem = treeview.dataItem(".k-item:first");
console.log(dataItem.text); // displays "foo"
</script>

See also: getting the node data in the select event handler

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy