Edit this page

dataItem

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

Parameters

element jQuery |Element |String

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

Returns

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

Example - get the data item of the first node

<select id="listBox"></select>
<script>
$("#listBox").kendoListBox({
    dataSource: [
        { id: 1, name: "foo" },
        { id: 2, name: "bar" }
    ],
    dataTextField: "name",
    dataValueField: "id"
});

var listbox = $("#listBox").data("kendoListBox");
var dataItem = listbox.dataItem(".k-item:first");
console.log(dataItem.name); // displays "foo"
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy