PDA

View Full Version : Treeloader baseParams 'lagging' when loading multiple trees into a single TreePanel.



n0cturnal
10 Dec 2007, 1:07 PM
I am working on a Filemanager for our website where I have a File Tree on several pages, all of which are different file trees and have no relation to one another.

I could have added a node for each 'page' in the tree, but to keep it simple for the users, I have created an 'Open Page' option in the toolbar, which will allow the user to select a Page (loads the Page's tree). I am sending the page name to my web service using the baseParams array in the treeloader, the toolbar 'Open Page' dropdown calls the function setPage (shown below) with the correct page name (verified by firebug).


setPage : function(pagename)
{
tree.loader.baseParams.page = pagename;
this.root.reload();
}

The problem is that when I call the setPage and write over the 'page' variable, it still sends the previous value. On the next request, when the tree is trying to load child nodes, the value seems to be correct. I though that maybe the baseParams array is getting copied to the loader after the request, so I tried the request twice, by calling this.root.reload(); twice in succession, but the second call does not perform a request.

Please help me fix this; with the exception of this issue I have found Ext to be a stupendous library, and have become somewhat of an Ext crusader, recommending it to lots of other people.

I could fix this by having the 'Open Page' dropdown send an Ajax request to store the page name in a session variable, but I don't have any other session variables at the moment, and would like to keep it that way if possible, besides it seems more logical to send it as a parameter with a treeloader request.

paladinjack
10 Dec 2007, 3:10 PM
I suggest you add eventlistener "beforereload" and "load",
to check the baseparams before and after the reloading.

Could it be the browser caching issue? If yes, can force the ajax call to add a unique identifier upon each call.