dataItem

Returns the data item to which the specified item is bound. The method will return an item only when the PanelBar is populated using a DataSource.

Parameters

node 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.Node The model of the item that was passed as a parameter.

Example - get the data item of the first node

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

    var panelBar = $("#panelBar").data("kendoPanelBar");
    var dataItem = panelBar.dataItem(".k-item:first");
    console.log(dataItem.text); // displays "foo"
</script>
In this article
Not finding the help you need? Improve this article