remove

Removes the specified item from the ListView. Triggers remove event and if not prevented calls the DataSource sync method.

Example

<script type="text/x-kendo-tmpl" id="template">
 <div>
   <dl>
     <dt>Name</dt> <dd>#:name#</dd>
     <dt>Age</dt> <dd>#:age#</dd>
  </dl>
  </div>
</script>

<button class="k-button" id="deleteBtn">Remove First Item</button>
<div id="listView"></div>
<script>
  $("#listView").kendoListView({
    template: kendo.template($("#template").html()),
    dataSource: {
      data: [
        { id: 1, name: "Jane Doe", age: 47 },
        { id: 2, name: "John Doe", age: 50 }
      ],
      schema: {
        model: {
          id: "id",
          fields: {
            id: { type: "number" },
            name: { type: "string" },
            age: { type: "number" }
          }
        }
      }
    }
  });
  $("#deleteBtn").click(function(){
    // get a reference to the list view widget
    var listView = $("#listView").data("kendoListView");
    // remove first list view item
    listView.remove(listView.content.children().first());
  });
</script>

Parameters

item Object

jQuery object which represents the item to be removed.

In this article