PDA

View Full Version : Ext Designer TreePanel URL Loader Question



adhoul
29 Jun 2010, 4:46 AM
Hello everybody,

I have created a UI class from Ext Designer (Viewport with tabPanel etc)

Inside a Tab there is a Fieldset where I want to have a TreePanel with checkboxes.

I have defined a TreePanel in Designer (which automatically assigns a Tree Node (root) and a Tree Load on it by default).

1) When i set the URL config option in the Tree Loader from inside the Designer everything works ok.


2) But What I want to do is to change the URL config option through my .js class (subclass of the UI class) without setting it / changing it from the UI.

I have tried to set it by getting the component through it's ID and assigning a URL on it's loader, but unfortunately it renders the Designer's default Loader first and for some reason which I don't understand doesnt show the data (although from Firebug I see it gets the JSON).

So my guess is it is something to do with Rendering, but I can't be sure. Any ideas how to dynamically change the URL of the Loader and make it work? thanks again

adhoul
30 Jun 2010, 1:14 AM
ok here's what i did to make it work:

since Designer assigns a Tree Node (root) and a Tree Loader on the TreePanel by default,


you assign a ID to the TreePanel, then get the TreePanel's loader and assign it the dataUrl you want


Ext.getCmp(treePanel.id).getLoader().dataUrl = treePanel.url;

this way it works