accordion("activate") issues

accordion("activate") issues


Hi Jörn,
I have once again run into some strange issues while trying to
dynamically manipulate an accordion, and was wondering if you might
have any insight into the cause.
I have an accordion menu which to which items can be added or removed
in real-time. To handle this I basically call "destroy" on the
accordion, add the new dom-node, and re-create the accordion. It seems
that some of the accordion-related events may be persisting even after
destroy is called. The reason I think this is that when I later make a
call to activate, it doesn't always behave properly initially.
Two examples of this are:
1. If I have an accordion item open, and then call "activate(-1)" to
close all items. When I next try to re-create the accordion menu, none
of the menu items open when clicked. If either none of the items are
open, or I do not call activate() to close the items, things work
fine.
2. After re-creating the accordion, I call activate() again on the
newly created item to move focus to that item. After doing this
however, the next time I click on the item header nothing will happen
at first. Only on the second try will the menu item begin to open and
close as usual.
I know this isn't exactly how you intended the accordion to be used,
but I was hoping maybe you would have some insight into what might be
causing the anomalies.
Thanks,
Keith