PDA

View Full Version : Load a Store with 'GET' method



sirkis
21 Nov 2011, 11:42 PM
Hello !

I try to load a Store by calling "GET" and not "OPTIONS" as default. I've added this "method: 'GET'," but it doesn't work.



var store = Ext.create('Ext.data.Store', {
autoLoad: true,
autoSync: true,
method: 'GET',
proxy: {
type: 'rest',
url: 'http://localhost:8080/zones',
}
});


Thanks for your answers ! :)

tvanzoelen
22 Nov 2011, 12:36 AM
try to set actionMethods on the proxy

like


actionMethods: {
read: 'GET'
}

sirkis
22 Nov 2011, 12:53 AM
Thanks but it doesn't work. Same problem...

tvanzoelen
22 Nov 2011, 12:59 AM
Its making a Post request?

sirkis
22 Nov 2011, 1:26 AM
No an "OPTIONS" request first, than a "GET" request.

tvanzoelen
22 Nov 2011, 1:34 AM
Strange. Maybe it is asking the server what methods are available for the rest. You can try to set the proxy type to ajax or set the api property for each CRUD method.

tvanzoelen
22 Nov 2011, 1:37 AM
Googling on this stuff says you are doing a cross-domain AJAX request.

Then you need proxytype jsonp