PDA

View Full Version : help with baseParams



chuvinha
28 Oct 2010, 3:28 AM
Hi guys, i am using the onBeforeload="atualizarId();" from treeLoader to call the function and pass the parameter that I need.
But itsn't working.




treeAtributos.on('beforemovenode',function(tree, node, oldParent, newParent, index) {
this.baseParams.campoId = campoId;
}



Could someone tell me what is wrong this function?

Condor
28 Oct 2010, 3:34 AM
What exactly are you trying to do, because that piece of code probably does nothing.

chuvinha
28 Oct 2010, 3:39 AM
Then Condor, I have a atribute campoId in my action and I want to set his.
When I call the dataUrl="resultarvorearea.action" I have to pass ass parameter the o id to set the atribute field campoId from action.
I am not able to do this.
Do you know how to do?

Condor
28 Oct 2010, 3:47 AM
Set the 'campoId' parameter to what?

The node id? Because for that you only have to configure the loader with nodeParameter:'campoId'.

chuvinha
28 Oct 2010, 3:58 AM
Set the 'campoId' parameter to what?

The node id? Because for that you only have to configure the loader with nodeParameter:'campoId'.

No Condor, is the user's id.
I need to pass o user's id before to loading the tree.
Did you understand?

Condor
28 Oct 2010, 4:01 AM
So you want something like:

tree.getLoader().baseParams = {campoId: myValue};
tree.getRootNode().reload();

chuvinha
28 Oct 2010, 4:56 AM
So you want something like:

tree.getLoader().baseParams = {campoId: myValue};
tree.getRootNode().reload();

It was work here.
Thank's very much Condor =))