Initialize PanelBar multiple times

6 posts, 0 answers
  1. Joseph Alfano
    Joseph Alfano avatar
    14 posts
    Member since:
    Sep 2009

    Posted 26 Sep 2012 Link to this post

    Is it safe to initialize a panel bar multiple times?  For example, could I do this?

    $('#panelBar').kendoPanelBar();
     
    // ... later after dom update ...
     
    $('#panelBar').kendoPanelBar();
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 29 Sep 2012 Link to this post

    Hi Joseph,

    I would not recommend a multiple initialization. Please first destroy the widget through its destroy method which will detach the event handlers and remove jQuery.data to avoid memory leaks.

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Robert Bross
    Robert Bross avatar
    27 posts
    Member since:
    Oct 2012

    Posted 08 Nov 2012 Link to this post

    Was the destroy method just recently added? I am trying to do this and the .destroy() method is failing with the following error...

    Uncaught TypeError: Object [object Object] has no method 'destroy'


    Here is the code that I'm using to attempt to destroy it...

    $('#' + CONST_CONTROL_PANELBAR_PANEL).data('kendoPanelBar').destroy();
    
  5. Joseph Alfano
    Joseph Alfano avatar
    14 posts
    Member since:
    Sep 2009

    Posted 08 Nov 2012 Link to this post

    I see the same behavior.  I think it's because the open source version doesn't have the destroy method.
  6. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 09 Nov 2012 Link to this post

    Hi guys,

    Yes, the destroy() method was introduced in the Q2 service pack (2012.2.913), while the open source versions do not get the service packs. However it is included in the Q3 beta and will be also available in the next release.

    Kind regards,
    Kamen Bundev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  7. Robert Bross
    Robert Bross avatar
    27 posts
    Member since:
    Oct 2012

    Posted 09 Nov 2012 Link to this post

    Thanks Kamen!
Back to Top
Kendo UI is VS 2017 Ready