PDA

View Full Version : set actionMethods to 'POST' is no effect for Ext.data.proxy.Ajax



digi005
5 Apr 2014, 12:19 PM
var store = Ext.create('Ext.data.Store', {
.........................................
proxy: {
type: 'ajax',
url: 'data.php',
actionMethods: 'POST',
..............................................

In the store create, I set the actionMethods to 'POST',
but it make a 'GET' request. not the 'POST' request.

evant
5 Apr 2014, 12:28 PM
The docs indicate actionMethods should provide an object.

http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.data.proxy.Ajax-property-actionMethods

digi005
5 Apr 2014, 8:26 PM
My code run at ExtJS 4.2.2 is ok. it make a 'POST' request fine.

But in ext-5.0.0.736(Beta) actionMethod: 'POST' is no effect, and make a 'GET' request.

evant
5 Apr 2014, 10:12 PM
I can't reproduce this. When I look in the network tab it makes a post for data.json:



Ext.require('*');

Ext.define('User', {
extend: 'Ext.data.Model',
fields: ['id', 'name'],
proxy: {
type: 'ajax',
url: 'data.json',
actionMethods: {
read: 'POST'
}
}
});


Ext.onReady(function() {
User.load(1);
});

digi005
5 Apr 2014, 10:44 PM
Thanks,
use the actionMethods: { read: 'POST' }
realley ok on ExtJS 4.2.2 and Ext-5.0.0.736(Beta).
It's really Solve my problem.

In the past, I always use actionMethods: 'POST'
and I don't known why it work on ExtJS 4.2.2 very good.

In the future, I will use the right way, actionMethods: { read: 'POST' }
Thanks your help.