这是我的商店代码:
var sql = Ext.create('Ext.data.Store', {
model: 'SQL',
groupField: 'project',
proxy: {
type:'ajax',
api: {
read: 'data/showText.php', // Called when reading existing records
update: 'data/saveRollout.php' // Called when updating existing records
},
actionMethods: {
read : 'GET',
update : 'POST'
},
reader: {
type: 'json',
root: 'data'
},
writer: {
type: 'json'
}
},
autoSync: true,
autoLoad: true
});
它发送正确的 json 代码
{
"projectId":102,
"project":"2G Rollout and Performance",
"taskId":123,
"description":"2)Capacity Sites Delta",
"january":123,
"february":0,
"march":0,
"april":0,
"may":0,
"june":0,
"july":0,
"august":0,
"september":0,
"october":0,
"november":0,
"december":0,
"id":null
}
但是php文件中的响应为NULL
var_dump(json_decode($_POST, true));// shows NULL on response