HI
I have a fairly large tree with around 10,000 nodes.
i want to display this and am building JSOn from a servlet for it. but the time to render this tree is too long
is there a way say i can only render the top level of the tree and then render nodes as they are clicked instead of building the whole tree... can i modify the tree widget somehow or is there some attribute for this functionality please help
Dino

QueryReadStore
If you user a QueryReadStore you can take the approach of loading the top level nodes, then re-query for each child as it's expanded - I describe the approach I took on this forum post (make sure to read all comments):
http://www.dojotoolkit.org/forum/dijit-dijit-0-9/dijit-support/dijit-tre...
Josh
getting into infinite loop
Hi
I've tried out your code with minor changes but the store/tree object fall into an infinite loop:
-Server X
-C:/Pubblica
-Server X
-C:/Pubblica
-Server X
-C:/Pubblica
...
This is the code:
// get top level nodes for this id
foldersStore.fetch({serverQuery:{levels:0},onComplete: onComplete});
} else if (foldersStore.getValue(parentItem, 'type')=='environment'){
foldersStore.fetch({serverQuery:{env: foldersStore.getValue(parentItem, 'name')}, onComplete: onComplete});
} else {
foldersStore.fetch({serverQuery:{levels:1,path: foldersStore.getValue(parentItem, 'path')}, onComplete: onComplete});
}
and these are the JSON contents for the 1^ call (TOP_ITEM) and the 2^ call (FIRST_CHILD) :
TOP_ITEM: {"items":[{"id":"env0","desc":"SVILUPPO","name":"Server X","path":"","children":[{"id":"unknown1","name":"C:/Pubblica","path":"C:/Pubblica","type":"unknown"}],"type":"environment"}],"label":"name","identifier":"id"}
FIRST_CHILD: {"items":[{"id":"folder0","name":"Pubblica","path":"C:/Pubblica","children":[],"type":"folder"}],"label":"name","identifier":"id"}
Any suggestion about this?
Thanks a lot
Bye
Fabrizio
hi fabrizio! i have the same
hi fabrizio!
i have the same problem! did you solve it already?
would you please give me a hint or something?
thanks a lot!
claudette
limitation
Hi
thanks for replying josh, i have a limitation of using only 0.9 build of dojo :-(
I thought of using get children but that does not result in an XHR call ... can u help out as to how to get JSON from server... currently i am using an out.println(myjsonString); the string is autogenerated. but goes upto 1.5 MB thus to load such a string in a single XHR call takes lot of time.
I thought of splitting this by only fetching the parents first and then each child on clicking of the parent but i will have to code a lot of seperate xhr calls for that i think....i dont have much exp of dojo please help out...
do i have to do this manually using dojo.get etc.. or is there a way around...
Thanks in advance dino