0
我試圖堅持電網更新到數據庫中,所以我在我的控制器寫:無法接收來自ExtJS的職位參數阿賈克斯
//...
editUser: function(button, eventObj) {
var view = Ext.widget('useredit');
view.down('form').loadRecord(this.getSelected());
},
getSelected: function() {
var grid = this.getUserList();
var selectedRecord = grid.getSelectionModel().getSelection()[0];
return selectedRecord;
},
updateUser: function(button) {
var win = button.up('window'),
form = win.down('form'),
record = form.getRecord(),
values = form.getValues();
record.set(values);
form.updateRecord();
win.close();
this.getUsersStore().sync();
}
});
這是我的店鋪代碼:
Ext.define('MyApp.store.Users', {
extend: 'Ext.data.Store',
model: 'MyApp.model.User',
autoLoad: true,
proxy: {
type: 'ajax',
actionMethods:
{create: 'POST', read: 'GET', update: 'POST', destroy: 'POST'},
api: {
create: 'data/createUser.php',
read: 'data/getUsers.php',
update: 'data/updateUser.php',
destroy: 'data/deleteUser.php'
},
reader: {
type: 'json',
root: 'users',
successProperty: 'success'
}
}
});
當我點擊「保存」按鈕螢火蟲告訴我,POST請求已發送到我的PHP文件,但是當我在PHP中打印_r($ _ POST) 它顯示我一個空數組。怎麼會這樣?