View Full Version : changing loader in a tree

21 Mar 2011, 4:52 AM
Just a quick question:

I'm loading a tree. Somewhere in the structure I have to change the nodes loader to fully expand the tree because the last bit is really different from the rest of the tree.

How do I do this? I've tried creating a loader in js called subLoader and I'm setting loader:'subLoader' in JSON

All i get is an error message in Firebug: "a.load is not a function" when I try to expand the parentnode.

What am I doing wrong?

21 Mar 2011, 5:20 AM
Some code:

var subLoader = new Ext.tree.TreeLoader({
id: 'subLoader',
directFn: My.subLoader,
nodeParameter: 'id'

var goalLoader = new Ext.tree.TreeLoader({
directFn: My.goalLoader,
nodeParameter: 'id'

this.treePanel = new Ext.tree.TreePanel({
id: 'goalTree',
cls: 'learn-treepanel',
animate: false,
draggable: false,
loader: goalLoader,

From the server I get this, hoping to change the nodes loader :

[{"id":1 ,"text":"Test","leaf":false,"loader":"subLoader"}]