This is a migrated thread and some comments may be shown as answers.

Initialize PanelBar multiple times

5 Answers 79 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Joseph Alfano
Top achievements
Rank 1
Joseph Alfano asked on 26 Sep 2012, 10:11 PM
Is it safe to initialize a panel bar multiple times?  For example, could I do this?

$('#panelBar').kendoPanelBar();
 
// ... later after dom update ...
 
$('#panelBar').kendoPanelBar();

5 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 29 Sep 2012, 08:20 AM
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!
0
Robert Bross
Top achievements
Rank 1
answered on 08 Nov 2012, 04:15 PM
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();
0
Joseph Alfano
Top achievements
Rank 1
answered on 08 Nov 2012, 04:25 PM
I see the same behavior.  I think it's because the open source version doesn't have the destroy method.
0
Kamen Bundev
Telerik team
answered on 09 Nov 2012, 09:12 AM
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!
0
Robert Bross
Top achievements
Rank 1
answered on 09 Nov 2012, 12:33 PM
Thanks Kamen!
Tags
PanelBar
Asked by
Joseph Alfano
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Robert Bross
Top achievements
Rank 1
Joseph Alfano
Top achievements
Rank 1
Kamen Bundev
Telerik team
Share this question
or