Categories | Question details Back To List | ||
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 Answer posted by Support on Oct 29, 2008 07:15 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*/ }) Answer posted on Oct 29, 2008 07:32 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 <params-values> to be sent on the next server call (url += url+'¶m0=value0¶m1=value1...¶mN=valueN'). I would suggest to use the userdata paradigm but the other way around :-)
Thanks
Answer posted by Support on Oct 29, 2008 10:31 >> 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. Answer posted on Oct 29, 2008 11:02 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 Answer posted by Support on Oct 30, 2008 05:07 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 ) http://dhtmlx.com/docs/products/dhtmlxAjax/index.shtml |