New to Kendo UI for jQuery? Start a free 30-day trial

Destroy

methods

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

<button  class='destroy'>Destroy</button>
<div id="drawer">
        <div>Content area content.</div>
    </div>
    <script>
        $(document).ready(function() {
            var drawerInstance = $("#drawer").kendoDrawer({
                mode: "push",
                template: `<ul><li data-role='drawer-item'><span class='k-icon k-i-star'></span><span class='item-text'>item 1</span></li><li data-role='drawer-separator'></li><li data-role='drawer-item'><span class='k-icon k-i-x-logo'></span><span class='item-text'>item 2</span></li></ul>`,
                position: 'left'
            }).data("kendoDrawer");

            $('.destroy').click(function() {
                drawerInstance.destroy();
            });
        });
    </script>
Not finding the help you need?
Contact Support