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

Initialisation of an empty PanelBar / Some questions

1 Answer 80 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Cuinn
Top achievements
Rank 1
Cuinn asked on 13 Feb 2012, 02:09 AM
Hi,

When you remove the last item in a panel bar it seems to remove the container as well (if it is a UL).  Additionally I notice that you only seem to be able to add an item if you provide an existing item to a insert before/insert after/append to.

The only way around this seems to be to provide a datasource to construct the panel bar from (essentially allowing initialisation of an empty DOM node).  However, how do I then change the items completely (eg. remove all of the items and add others?  Do I need to destroy and replace the container to do this?

Also, if the container is a DIV and not a UL, you get a DIV with LI subitems in it, which seems to display fine, but which is probably not correct.  Perhaps this should be checked on initialisation of the control and a wrapper constructed/initialisation aborted??

These issues also seem to affect the Menu control as well.

Regards,
Cuinn.

1 Answer, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 13 Feb 2012, 04:05 PM
Hi Cuinn,

The root element removal was a bug, I've fixed it for the next release. I've also updated your points for the find.

If you initialize the PanelBar with a dataSource object, it will remove all the items in it and recreate it using the new data (in effect from the service pack). However this will leave the events bound to the root element intact and you should call yourPanelbar.element.undelegate() before doing it (we will try to fix this for the next release).

Thank you for the div suggestion, actually this will probably happen with any other element as well. We will try to fix it for one of the next releases.

All the best,
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!
Tags
PanelBar
Asked by
Cuinn
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Share this question
or