Accordion and dynamic changes to its elements, anomalies

Accordion and dynamic changes to its elements, anomalies


I have been doing some dynamic things with accordion and have found
some areas that I would like to discuss to see if accordion could
accomodate them, or if I should try to extend or rewrite it on my own.
I'm doing some very dynamics things with the content that lives in the
accordion. The problems I've found seem to stem from accordion
getting out of sync with the changes that are made to the data after
accordion is called and setup. I haven't unraveled why the problems
are happening yet but it appears to be the inability to tell accordion
things have changed so it can update its state to the new elements and
their sizes.
I have provided a sample page that demonstrates one of the problems I
have found with accordion and my tecniques.
Last night I discovered another anomaly. If I hide/show some elements
in a form in an accordion, the accordion doesn't detect the new size
of the enclosed elements.
Do I simply call accordion as I did the first time to get it reset to
the new elements and their sizes? Do we need a new method to tell the
accordion that things have changed? Does accordion need a destroy
method to get rid of old cached data?
I have tried to understand how accordion works to see what might be
happening but as yet have not sussed out how accordion does its magic.
I will help with the process anywhere I can, but I need to know more
about how it works to be useful. Is there any description anywhere
that might help me understand the design arcitechture of accordion, or
do I simply have to disect it to find out?
I will be updating the example page to add the new stuff that causes
the second set of anomalies, but I would like to figure out the first
problems before tackling the second.
Example of broken accordion:
Works 1st time and then broken until refresh of page.
http://dataprism.net/dpui/test2.html
Click on "Open Inspector" to open the inspector pane and use the
accordion, it works great.
Click on "Close Inspector" to close the inspector pane.
Now click on "Open Inspector" and the accordion is broken. Page
refresh fixes it.
When I open the inspector I dynamically build the html that will be
accordioned and call accordion.
When I close the inspector I empty the accordion data, as the next
time the inspector is opened it may be inspecting a different object.
The accordion seems to get out of sync with the new data.
I've also found that if I hide/show elements in a form in the
accordion, the accordiong gets out of sync with the new size of that
accordion panel.
Do we need an update method in accordion to get it to resync with the
elements and their sizes, or should I simply call it again? It seems
to retain some old data somewhere that doesn't get flushed. Or maybe
I just don't get what is going on.
Any help would be greatly appreciated.
Thanks,
ml