PDA

View Full Version : Save and Load a Store with different URLs?



macap
3 Feb 2011, 7:23 AM
Hi,

I am using a MS WCF REST service to handle the server side of my application.
AFAIK it is not possible in a real WCF service to load and store via the same REST Url.

That´s why I need different URLs for loading and saving data of the same store.

All examples I have found always use the same url.
Is there a way to use different ones?
Or do I have to create a second store and copy between them?

It would be great if someone could provide an example.


Regards,

Martin

shrivas
3 Feb 2011, 11:06 PM
You can probably do an Ext.Ajax.Request to the second URL and bind it's response to the same store. Something like:


Ext.Ajax.request({
url: url,
method: 'POST',
headers: { 'Content-Type': 'application/json;charset=utf-8' },
success: function(response, opts) {
store.loadData(Ext.decode(response.responseText))
}
})