New to Kendo UI for jQuery? Start a free 30-day trial

DataItem

methods

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

Parameters:elementjQuery|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.

<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-list-item:first");
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(dataItem.name); // displays "foo"
</script>
Not finding the help you need?
Contact Support