Edit this page

destroy

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

Example

<div id="foo" data-role="view">
  <input id="switch" type="checkbox" data-role="switch" />
  <a data-role="button" data-click="onClick">Destroy</a>
</div>

<script>
var app = new kendo.mobile.Application();

function onClick() {
  var switchInstance = $("#switch").data("kendoMobileSwitch");

  switchInstance.destroy();
  switchInstance.wrapper.remove();
}
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy