PDA

View Full Version : TreeLoader baseParams when using directFn



MoShAn480
15 Sep 2009, 1:25 PM
Hi,

I am creating a TreeLoader using the directFn. When the load is triggered, it only sends a single parameter which is the node ID of the tree node which is being expanded. Although I am setting the baseParams, it is not being sent when tree is expanded. Is there anyway to send the baseParms with the TreeLoader using directFn? Also, is there a way to send the nodeId as a parmeter object or key/val instead of a string like what is being sent:

{"action":"AdminConsole","method":"exploreWorkgroup","data":["queues-root"],"type":"rpc","tid":9}

thanks!

mike.slattery
17 Sep 2009, 11:26 AM
bump! interested to see the answer to this!

Artistan
24 Sep 2009, 7:12 AM
You need to set the paramOrder so it knows to use your baseParams...


paramOrder:['var1','var2'],

Artistan
24 Sep 2009, 7:14 AM
Hi,
Also, is there a way to send the nodeId as a parmeter object or key/val instead of a string like what is being sent:
[/FONT]

I believe paramsAsHash will do this.

ZsoltK
17 Oct 2009, 4:41 AM
I have bumped into the same problem, however, setting neither of baseParams, paramsAsHash solved it.

After many hours of experimenting in vain, I figured the problem was with the directFn's len parameter. It was set to 1, but the TreeLoader sends data like this:

data[node id, {baseParams}]

So regardless of the parameter hash, the node id gets sent at the first place, and if you have directFn len=1, the hash will not be sent! Setting len=2 solved the problem. I'd have expected all the parameters (including the node id) being sent in a single hash, that's why it took me so long to figure. Hope this helps others too.

MoShAn480
20 Oct 2009, 6:38 PM
Cool, that worked for me along with adding the paramOrder. Good find, since it was not in the documents any where...THANKS!