How to pass additional parameters to the setAutoLoadingURL?

I need to add additional parameters every once in a while… Is there any special way to do that except reseting the AutoLoadingURL?





Thanks

Which component do you mean ? As  neither tree nor grid has setAutoLoadingURL method.

If you meant setXMLAutoLoading method in tree, you can reset url by calling the same method once again.

Or you can set function which will be called instead of url (only for PRO edition):

tree.setXMLAutoLoadingBehaviour(“function”);

tree.setXMLAutoLoading(function(item_id){

/your code here/

})


I meant the setXMLAutoLoading method of the DHTMLXTree;



I tried to reset the URL by calling the method again, but it didn’t seem to work (didn’t test it thoroughfully tough, will check again);



 



Anyway, isn’t there a way to define additional params to be passed on the next tree-call? Just like the id is sent automatically, it would be nice to have a mechanism to set the to be sent on the next server call (url += url+’&param0=value0&param1=value1…&paramN=valueN’). I would suggest to use the userdata paradigm but the other way around :slight_smile:



 



 



Thanks



 

I tried to reset the URL by calling the method again, but it didn’t
seem to work (didn’t test it thoroughfully tough, will check again);

Locally, this approach works.

>> Anyway, isn’t there a way to define additional params to be passed on the next tree-call?

In our previous message we have written about loading behaviour (PRO edition).

In this case, you can do for example the following:
 
tree.setXMLAutoLoadingBehaviour(“function”);

var c= 1;

tree.setXMLAutoLoading(function(item_id){

tree.loadXML(url+"?c="+c+"&id="+item_id+"&level="+tree.getLevel(item_id));

c++;
})
This code will pass to the server item id and item level when new branch should be loaded.

Thanks,

Rewriting the behaviour is still a way of rewriting the url which conceptually speaking isn’t my objective.
I don’t need to mess with the base url, I just want to obtain a generic way of sending a parameter list with the values back to server;


Thanks for your effort.


Cheers

There is no way to set parameters separatly from base url.
You can define them as part of url initially, or use the code described above to control how url will look ( which allows to set any possible parameters )

If you just need to made a server side call, not related to data loading, you can use dhtmlxAjax ( which is part of dhtmlxcommon.js and avaialable as part of any component )
dhtmlx.com/docs/products/dhtmlxAjax/index.shtml