PDA

View Full Version : is httpproxy bound to a single url?



sean
5 Apr 2007, 3:35 PM
hi all,

i'm working with a grid that is initially loaded using one url. later i want to reload the store from a different url based on a user's filter criteria. the grid is exactly the same, ie json + column model. i was hoping that i could just pass the url and the params in a config obj to the store's reload method but this isn't going to work after looking at the httpproxy source. the url that i pass to store.load() method via an options obj is simply passed as the arg property to the connection's request method.

in any case does anyone have an alternative. i was thinking that i would just create a new httpproxy and set it on the store. the only complication to this is that i need to also ensure that loadexceptions get relayed to the store, something that is set in the store's constructor. would appreciate any input.

thanks,
sean

tryanDLS
5 Apr 2007, 5:54 PM
You should be able to pass the url all the way from store



params = {foo:'bar', url:'myurl'};
store.load({scope:this, params:params})



Another way (might not be intended as public)


proxy.getConnection().url = myUrl;

sean
5 Apr 2007, 7:12 PM
tim,

i did try passing a url property in the params, exactly as your sample shows. if you follow the code from the store -> proxy -> connection i think you will see that this won't work. perhaps i'm missing something.

is the sample that you posted something that you have done before in your implementations? i would prefer not to set the url property directly on the connection.

sean

tryanDLS
5 Apr 2007, 7:49 PM
No, I guess that doesn't work. However, my 2nd suggestion to set it on the connection is valid. It's really no different than if you were creating a Connection yourself with


var conn = new Ext.data.Connection({url:'myUrl'})


If you can set it via the config object, it's considered public.