PDA

View Full Version : Changing store URL and reloading issue



karthik_br
9 Jan 2011, 12:17 PM
Hello,

I am trying to change the store URL depending on user interaction. The url in store changes correctly but the data in store is not reloaded though I call load. Do I need to do something else or is this a bug?

The reader below is a JSON reader.


return new Ext.data.GroupingStore({
reader: reader,
url : properties.Url,
autoLoad : true,
groupField : 'gName',
});


Here is the code to change URL:


var propGrid = Ext.getCmp("prop_grid");
if(propGrid)
{
var propstore = propGrid.getStore();
if(!propstore)
return;

propstore.url = properties.newUrl; //URL changes correctly
propstore.load(); //This should work????
//popstore.reload(); //Tried this too...

/*Ext.TaskMgr.start({
run: propstore.reload,
scope: propstore,
});*/ //Tried this too....
}


Thanks,
Karthik

tobiu
9 Jan 2011, 5:28 PM
according to the api docs:



url : String
If a proxy is not specified the url will be used to implicitly configure a HttpProxy if an url is specified. Typically this option, or the data option will be specified.


url is a config, not a public property.

if you address the HttpProxy, you have a public method setUrl.


best regards
tobiu

karthik_br
12 Jan 2011, 8:13 PM
Thanks for the information. It would have been very convenient if url was a public property.