PDA

View Full Version : jsonstore not loaded with data



spor
29 Oct 2010, 2:14 AM
I have a jsonstore that loads the data via an url, as a restful get service. However the store doesnt seem to store the data from the json data, even though the service is invoked with data returned. Do you know why?

I have tried this also:

this.store.proxy.api.read.url = 'services/folder/getFolder/
this.store.reload({
});

Now, I noticed in Firebug that the code above didn't change the url on the proxy either, which is weird, because similar code has worked before.

The idea is to use the data in the jsonstore and load it into a form.

plalx
29 Oct 2010, 5:35 AM
Well... when calling reload(), is the right url getting called, when looking in FF? Listen to the exception event of the store to see if there's any error.

spor
1 Nov 2010, 1:45 AM
I have resolved setting the new url by creating a new proxy. However, there is still problem loading the json data to the store. The fields and model config are correctly set.

The service with the specified url is invoked and returned when calling the following,
this.store.reload();

Shouldn't the store also be loaded with the returned data?

Condor
1 Nov 2010, 3:02 AM
Do NOT create a new proxy, just to change the url.

A proxy has a setUrl method that you can use, or - if you use an api - use the code you used in your first post.