Initialisation of an empty PanelBar / Some questions

2 posts, 0 answers
  1. Cuinn
    Cuinn avatar
    13 posts
    Member since:
    Aug 2011

    Posted 12 Feb 2012 Link to this post


    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.

  2. Kamen Bundev
    Kamen Bundev avatar
    1532 posts

    Posted 13 Feb 2012 Link to this post

    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!
Back to Top