destroy
Prepares the component for safe removal from the DOM. Detaches all event handlers and removes jQuery.data attributes to avoid memory leaks. Calls the destroy method of any child Kendo components.
If a new ContextMenu component should be created afterwards, use a new <ul> for that, as the old one no longer exists.
This method does not remove the component element from DOM. To do so follow the approach in this article.
Example
<div id="target">Target</div>
<ul id="context-menu">
<li>Item 1
<ul>
<li>Sub Item 1</li>
<li>Sub Item 2</li>
<li>Sub Item 3</li>
</ul>
</li>
<li>Item 2
<ul>
<li>Sub Item 1</li>
<li>Sub Item 2</li>
<li>Sub Item 3</li>
</ul>
</li>
</ul>
<script>
// initialize the ContextMenu
$("#context-menu").kendoContextMenu({
target: "#target"
});
var contextMenu = $("#context-menu").data("kendoContextMenu");
// detach events
contextMenu.destroy();
</script>