How to reinitialize dynatree?

432 views
Skip to first unread message

moritz

unread,
Jun 30, 2009, 6:20:48 PM6/30/09
to Discuss jquery.dynatree.js
I'm trying to use dynatree to display some hierarchical data, but need
to combine it with paging.

Basically, I'm starting out with a <ul>-list, which is nicely
initialized as a dynatree on page load. For paging purposes, I am
replacing the original <ul>-list, or better said the content of the
<div id="tree"> element, with a new <ul>-list via XmlHttpRequest, but
I can't seem to find a way to force a reinitialization of the new <ul>-
list as a dynatree. Calling $("#tree").dynatree({ }); onComplete does
not seem to accomplish that. Are there other options?

I'm not an expert in jQuery, so there could be a trivial mistake. I
hope that I'm not stretching the dynatree architecture too much.

Any pointers or other suggestions on how to use dynatree in
combination with paging are very welcome. Thanks in advance.

moritz

unread,
Jun 30, 2009, 9:10:27 PM6/30/09
to Discuss jquery.dynatree.js
Calling $("#tree").dynatree("destroy"); before calling $
("#tree").dynatree({ }); seems to do the trick.

I would still love to hear about alternative approaches.

mar10

unread,
Jul 1, 2009, 2:08:32 AM7/1/09
to Discuss jquery.dynatree.js
Hi,

you could also try to use the initAjax option.
Or call .removeChildren() + .appendAjax() on the root node.

I am not sure, if this works to re-initialize, but if not, you could
start an iussue on this.

regards
martin
Reply all
Reply to author
Forward
0 new messages