Cleanup Best Practices

3 posts, 0 answers
  1. Tess
    Tess avatar
    6 posts
    Member since:
    Apr 2012

    Posted 17 May 2012 Link to this post

    My application has a lot of windows, containing forms and other views of data that have been bound to observables, using the kendo.bind function.  Many of these windows are created and destroyed, over the course of the application lifetime.

    My question is this:  Is it necessary to call kendo.unbind on the contents of these windows, prior to destroying them, or will they automatically clean up their observable bindings?

    Also, are there any other best practices I should be aware of, for tidying up after deleting these form windows?
  2. Brian LeBaron
    Brian LeBaron avatar
    2 posts
    Member since:
    May 2010

    Posted 07 Mar 2013 Link to this post

    I have this same question.
  3. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 12 Mar 2013 Link to this post


     The recommended cleanup method is to call the destroy() method of the Kendo UI widgets. A convenient method called kendo.destroy can be used to find all Kendo UI widgets in a DOM tree.

     Here is an example:
    <div id="widget-container">
          <input id="autocomplete" />
          <input id="numerictextbox" />

     //cleanup all widgets inside "widget-container"


    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top