destroy

Prepares the ListView for safe removal from DOM. Detaches all event handlers and removes jQuery.data attributes to avoid memory leaks. Calls destroy method of any child Kendo widgets.

Important: This method does not remove the ListView element from DOM.

Example

<div data-role="view">
   <a data-role="button" data-click="destroyListView">Destroy</a>

  <ul id="listView" data-role="listview" data-style="inset">
    <li>Foo</li>
    <li>Bar</li>
  </ul>
</div>

<script>
function destroyListView() {
    var listView = $("#listView").data("kendoMobileListView");
    // detach events
    listView.destroy();
}

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