destroy

Prepares the View 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 View element from DOM.

Example

    <div data-role="view" id="main">
        <a data-role="button" data-click="destroyView">Destroy and remove view</a>
    </div>


    <script>
    function destroyView() {
      $("#main").data("kendoMobileView").destroy();
      $("#main").remove();
    }
    new kendo.mobile.Application();
    </script>

In this article