PDA

View Full Version : [1.1.1] AsyncTreeNode won't reload if children defined with initial load



photoz
18 Oct 2007, 6:07 AM
using:
ext.base / XP / FF2.0.7

I have a TreePanel and load the majority of the structure on initial load, which works fine.
This is the JSON that comes down first:

[{"text":"Section 2","id":"source\/s140","leaf":false,"cls":"folder","title":"Section 2","qtip":null

,"disabled":false,"canFilter":false,"children":[{"text":"Section2_F1","id":"source\/s140\/f495","leaf"

:false,"cls":"form","title":"Section2_F1","qtip":null,"disabled":false,"canFilter":true,"children":[

{"text":"Section2_F1","id":"source\/s140\/f495\/q1605","leaf":false,"cls":"question","title":"Section2_F1"

,"qtip":null,"disabled":false,"canFilter":true,"children":null}]}]}]

So the children property is defined.
Now when I try to reload say that first node (Section 2), it doesn't make the callback, I'm watching with FireBug.

Here is how my TreePanel and root node are setup:


tree = new Tree.TreePanel('tree-div-tree', {
id:'instrument-tree',
animate:false,
enableDD:true,
containerScroll: true,
lines:false,
rootVisible: false
});
var myLoader = new Tree.TreeLoader({
dataUrl:'../ws/loadtree.aspx',
baseParams:{filter:''}
});
myLoader.on("beforeload", function(treeloader, node) {
myLoader.baseParams.filter = filterText;
}, this);
myLoader.on("load", function(treeloader, node) {
if (filterText != "") {
tree.root.expandChildNodes(false);
}
});
var root = new Tree.AsyncTreeNode({
text: 'Instrument',
draggable: false,
loader: myLoader,
id:'source'
});
tree.setRootNode(root);
tree.render();
root.expand();