when I use AsyncTreeNode,I found that AsyncTreeNode's loader can't override
for ex:
代码
1 var tree = new Ext.tree.TreePanel({
2 xtype: 'treepanel',
3 el:'tree',
4 animate:true,
5 autoScroll:true,
6 containerScroll:true,
7 autoHeight: true,
8 loader: {dataUrl: "http://server/webapps/treePanel.jsp"},
9 root:
10 {
11 text: 'root2',
12 draggable:false, // disable root node dragging
13 loader: {dataUrl: "http://server/webapps/treeNode.jsp"},
14 id:'root',
15 expanded: true
16 }
17 });
18 tree.render();
19 });
20
2 xtype: 'treepanel',
3 el:'tree',
4 animate:true,
5 autoScroll:true,
6 containerScroll:true,
7 autoHeight: true,
8 loader: {dataUrl: "http://server/webapps/treePanel.jsp"},
9 root:
10 {
11 text: 'root2',
12 draggable:false, // disable root node dragging
13 loader: {dataUrl: "http://server/webapps/treeNode.jsp"},
14 id:'root',
15 expanded: true
16 }
17 });
18 tree.render();
19 });
20
when I click root2 Node,"http://server/webapps/treeNode.jsp" never gets called。
check source code,maybe there is a bug
createNode:function(attr)
......
if(this.applyLoader!==false){attr.loader=this;}----------------set treePanel's loader to node's loader,the scope of "this" maybe point to treepanel.
so I changed:
if(this.applyLoader!==false){if(attr.loader==null)attr.loader=this;}
dang dang dang dang.It's work now!well done!