destroy

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

This method does not remove the ListBox element from the DOM.

Example

<select id="listBox"></select>
<script>
$("#listBox").kendoListBox({
     dataSource: {
        data: [
            { name: "Jane Doe" },
            { name: "John Doe" }
        ]
    },
    template: "<div>#:name#</div>"
});
// get a reference to the list view widget
var listBox = $("#listBox").data("kendoListBox");
listBox.destroy();
</script>
In this article