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
0
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
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...
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
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
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!