PDA

View Full Version : Huge Checkbox Tree with un-/check all Problem



DeDarling
8 Nov 2010, 1:56 AM
Hi,

i have a tree with round about 8300 Items....

like

+Geo
|-+0
|--+01
|---+01532
|-+1
|-+....

I load the nodes async with PHP.

Now i would check/unchek all nodes/childnodes ... but my Problem is the async load of the nodes .. i must load all nodes to become the function i used working ...


function toggleCheck(node,isCheck)
{
if(node)
{
node.eachChild(function(n) {
n.eachChild(function(n1) {
toggleCheck(n1, isCheck);
});

n.getUI().toggleCheck(isCheck);

this.attributes.checked = isCheck;
if(isCheck)
n.getUI().show();
});
}
}


listeners:
{
'checkchange': function(node, checked){
if(checked)
var tree_geo = toggleCheck(node,true);
else
var tree_geo = toggleCheck(node,false);
},
'afterrender': function(){
/*
tree_geo.suspendEvents();
tree_geo.expandAll();
tree_geo.resumeEvents();
*/

tree_geo.suspendEvents();
tree_geo.collapseAll();
tree_geo.resumeEvents();
}
}

I tried to expand all at start but this take minutes ... :(
and then i tried to collapseAll but this dont works ...

any suggetions ?