Refresh the full tree

797 views
Skip to first unread message

fra...@gmail.com

unread,
Apr 20, 2009, 4:55:44 AM4/20/09
to Discuss jquery.dynatree.js
Hello,
I would like to know how to refresh the whole tree using ajax method.
I'm unable to find how to do this.

Explications :
I have a tree and a user can click on, it open a menu into an iframe
to rename, remove the selected item. One time it's don, my database is
updated but not my tree of course. I would like to call a function to
refresh my tree.

Thanks !

mar10

unread,
Apr 20, 2009, 1:51:08 PM4/20/09
to Discuss jquery.dynatree.js
haven't tried it, but does
rootNode.removeChildren(true)
rootNode.appendAjax(..)
work?

fra...@gmail.com

unread,
Apr 21, 2009, 3:07:37 AM4/21/09
to Discuss jquery.dynatree.js
Thank you for your answer. I'm going to try and I say you if it's
done.

fra...@gmail.com

unread,
Apr 21, 2009, 3:24:29 AM4/21/09
to Discuss jquery.dynatree.js
In fact I think i don't understand how to write it ...

here is mys code, could you help me please ?

$(function(){

$("#tree").dynatree({
checkbox: true,
selectMode: 2,
[...]
});

function reloadTree(){
$("#tree").dynatree.rootNode.removeChildren(true);
$("#tree").dynatree.rootNode.appendAjax();
}

And when i call reloadTree function I have an error :
Erreur : $("#tree").dynatree.rootNode is undefined

I'm sorry I begin with jquery and I haven't all understand again ...

Thanks !


On 20 avr, 19:51, mar10 <moo...@wwWendt.de> wrote:

mar10

unread,
Apr 21, 2009, 3:26:41 PM4/21/09
to Discuss jquery.dynatree.js
this could be your refresh function:

var rootNode = $("#tree").dynatree("getRoot");
rootNode.removeChildren();
rootNode.appendAjax({
url: "...",
data: {...}
});

You could pass the same argumentds to appendAjax() that you passed to
initAjax()
m~
Reply all
Reply to author
Forward
0 new messages