How to set HTTP method in Ext.data.Store

Normally if You declare store in ExtJS the default HTTP method is POST. Sometimes You need send data using GET method, so ExtJS is fortunatelly flexible enough to make it possible. You'll just need to create You own HttpProxy and change this proxy method to GET.

Default way using POST method:


var securities = new Ext.data.JsonStore({
url: 'some url...',
root: 'some json root...',
fields: [some fields...]
});


Store settings medified to send data using GET method:

var securities = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({url: 'some url...', method: 'GET'}),
root: 'some json root...',
fields: [some fields...]
});

0 comments:

Newer Post Older Post Home