destroy

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

The destroy method does not remove the ScrollView element from the DOM.

Example

<div id="scrollView">
  <div data-role="page">Foo</div>
  <div data-role="page">Bar</div>
</div>

<script>
$("#scrollView").kendoScrollView();

function destroyScrollView() {
  var scrollView = $("#scrollView").data("kendoScrollView");
  scrollView.destroy();
  $("#scrollView").remove();
}
</script>
In this article