setDataItem

Re-renders the given listview item with the new dataItem provided. In order for the method to work as expected, the data items should be of type kendo.data.Model.

Parameters

item jQuery

The listview item to update

dataItem kendo.data.Model

The new dataItem

    <div data-role="view" data-init="initialItem">
        Add item
        <ul id="listview" data-role="listview" data-template="foo">
        </ul>
    </div>


    <script type="text/x-kendo-template" id="foo">
    Item #: idx #
    </script>

    <script>
    var dataItem = new kendo.data.Model({ idx: 1 });

    function initialItem() {
      $("#listview").data("kendoMobileListView").append([dataItem]);
    }

    function changeItem() {
      var newItem = new kendo.data.Model({idx: 2});
      $("#listview").data("kendoMobileListView").setDataItem($("#listview li").eq(0), newItem);
    }

    new kendo.mobile.Application();
    </script>
In this article