PDA

View Full Version : TreeLoader doesn't populate tree with directfn



pbartels
8 Apr 2010, 5:20 AM
Code :


var patientTreePanel = new Ext.tree.TreePanel({
layout:'fit',
region:'west',
width:300,
margins : "0 0 0 0",
border:true,
split: true,
collapseMode:'mini',
autoScroll: true,
root: {
id: 'root',
text: 'Units'
},
loader: new Ext.tree.TreeLoader({
directFn: Patient.GetUnits
})
});


JSON Request:
{"action":"Patient","method":"GetUnits","data":null,"type":"rpc","tid":2}

JSON Result:
{"type":"rpc","tid":2,"action":"Patient","method":"GetUnits","result":[{"id":"n0","leaf":true,"text":"Pediatrie"},{"id":"n1","leaf":true,"text":"Neonatologie"},{"id":"n2","leaf":true,"text":"Leeuw"}]}


Please check!

pbartels
8 Apr 2010, 6:20 AM
If I change the requestData function in Ext.tree.TreeLoader:

From


this.directFn.apply(window, args);

Into:



this.directFn(this.processDirectResponse.createDelegate(this, [{ callback: callback, node: node, scope: scope}], true));


It will work. Can anyone explain this behavior?

Thanks in advance!