PDA

View Full Version : Problem with too big TreePanel



Footeuz
9 Aug 2007, 5:26 AM
Hello,

My problem is that i have two trees and the first one could have more than 8000 elements.
But it seems that the browser don't like when I have more than 5000 elements.

At the beginning i was using a TreeLoader with a dataUrl and now i'm charging my TreePanel with a children in my root like that :




var tree = new Tree.TreePanel('tree', {
animate:true,
loader: new Tree.TreeLoader(),
enableDrag:true,
enableDrop:false,
selModel: new Ext.tree.MultiSelectionModel(),
containerScroll: true,
allowCopy:true,
dropConfig: {appendOnly:false}
});

var response = chaine_dim.dom.innerHTML;

//Ext.MessageBox.alert("boite",response);
var root = new Tree.AsyncTreeNode({
text: 'Valeurs disponibles',
draggable:false, // disable root node dragging
allowCopy:true,
id:'source',
children:response.evalJSON(true)
});
tree.setRootNode(root);

// render the tree
tree.render();


Anybody has an idea ?
to seperate my treatement ?

BernardChhun
9 Aug 2007, 6:02 AM
hey Footeuz,

are you using a fully asynchronous TreePanel?
I hope you aren't specifying *ALL* your root's children in its config attribute. that would kill you app with so many nodes.

you have to load one level of nodes at a time. then load the clicked node children only if it is clicked on. that is usually handled automatically by the TreePanel.

Footeuz
9 Aug 2007, 6:27 AM
No the problem is that all my childrens are childrens of the main node.
And it's expand at the beginning.

BernardChhun
9 Aug 2007, 6:35 AM
No the problem is that all my childrens are childrens of the main node.
And it's expand at the beginning.

hmm in that case, I wouldn't use the TreePanel at all to show that data.
I'd probably make my own server side templates to show the data structured like a tree.
But it will be hardeous even for the server side :((

Footeuz
9 Aug 2007, 6:44 AM
that's what i thought lol
so...

Anyway thanks for your help.