extjs4 ajax api存储更新

extjs4 ajax api存储更新,extjs4,Extjs4,在使用cellediting和gridpanel中的组合框更新记录后,我尝试更新我的存储,然后更新数据库。ajax代理中的update operation.action启动正确,只是存储和网格没有同步,firebug中的post选项卡显示我的json如下:“data[]”。如何获取存储记录以创建json并更新记录?谢谢你提前看这个 Ext.Loader.setConfig({ 已启用:true }); setPath('Ext.ux','/extjs4/examples/ux'); 外部要求([

在使用cellediting和gridpanel中的组合框更新记录后,我尝试更新我的存储,然后更新数据库。ajax代理中的update operation.action启动正确,只是存储和网格没有同步,firebug中的post选项卡显示我的json如下:“data[]”。如何获取存储记录以创建json并更新记录?谢谢你提前看这个

Ext.Loader.setConfig({
已启用:true
});
setPath('Ext.ux','/extjs4/examples/ux');
外部要求([
“Ext.layout.container.Fit”,
“Ext.grid.*”,
“Ext.data.*”,
“Ext.util.*”,
“Ext.panel.*”,
“Ext.selection.CellModel”,
“Ext.state.*”,
“Ext.form.*”,
“Ext.ux.CheckColumn']);
Ext.define('Ext.app.HirePlanGrid'{
扩展:“Ext.panel.panel”,
别名:“widget.hirePlangrid”,
hireplanstoreId:“hireplanstore”,
hiremonthstoreId:“hiremonthstore”
,
renderMonth:函数(值、p、记录){
var fkStore=Ext.getStore(this.up('hirePlangrid').hiremonthstoreId);
var rec=fkStore.findRecord(“月份ID”,值);
//return rec.get(“缩写月”);
}
,
initComponent:函数(){
var rIdx='';
var-cIdx='';
this.editing=Ext.create('Ext.grid.plugin.CellEditing'{
单击编辑:1,
听众:{
“beforeedit”:函数(e){
var me=这个;
var allowed=!!me.isEditAllowed;
如果(!me.isEditAllowed)Ext.Msg.confirm('confirm','you sure',函数(btn){
如果(btn!=“是”)返回;
me.isEditAllowed=true;
我,按位置开始({
世界其他地区:e.rowIdx,
列:e.colIdx
});
});
rIdx=e.rowIdx;
cIdx=大肠杆菌;
//警报('rIdx='+rIdx+'cIdx='+cIdx);
允许返回;
},
“编辑”:函数(e){
this.isEditAllowed=true;
}
}
});
var objMonthStore=Ext.getStore(this.hiremonthstoreId);
load();
var objStore=Ext.getStore(this.hireplanstoreId);
objStore.setProxy({
键入:“ajax”,
url:'hireplan.cfc?方法=getEmployees'
});
load();
var onDeleteClick=函数(字段、值、选项){
//var objPanel=this.down('gridpanel');
var selection=Ext.getCmp('grid').getSelectionModel().getSelection();
//警报(选择);
//变量选择=getView().getSelectionModel().getSelection()[r];
如果(值){
//警报(值);
objStore.remove(值);
objStore.sync();
}
};
var onUpdateClick=函数(字段、值、选项){
警报('field='+field+'value='+value+'options='+options');
update(this.hireplanstoreId,值'update',选项);
同步();
};
var onSync=函数(){
objStore.sync();
};
Ext.apply(本{
布局:“适合”,
宽度:800,
//身高:1500,
项目:[{
xtype:'网格',
id:'gridgrid',
//身高:300,
商店:objStore,
selModel:{
selType:'cellmodel'
},
selType:“行模型”,
插件:[this.editing],
//插件:[cellEditing],
专栏:没错,
视图配置:{
stripeRows:对
},
//loadMask:是的,
disableSelection:正确,
栏目:[{
标题:“rowid”,
隐藏:是的,
数据索引:“ROWID”
}, {
标题:“指示器”,
id:'chkcolumn',
xtype:“检查列”,
数据索引:'CHK_COL',
编辑:{
xtype:'复选框',
cls:'x-grid-checkheader-editor'
},
听众:{
checkchange:函数(列、记录索引、选中){
警报(“选中的rindex=”+记录索引);
onDeleteClick(列、记录索引、选中);
//或者发送请求
}
}
}, {
id:“employeeid”,
标题:“employeeid”,
宽度:80,
隐藏:假,
可排序:是的,
数据索引:“EMPLOYEEID”,
弹性:1
}, {
id:'国家编号',
标题:“国家编号”,
宽度:80,
可排序:是的,
数据索引:“国家编号”,
弹性:1
}, {
id:“MARITALSTATUS”,
标题:“MARITALSTATUS”,
宽度:80,
可排序:是的,
数据索引:“MARITALSTATUS”,
弹性:1
}, {
id:“潜在内购KV”,
标题:“内包潜力”,
宽度:30,
可排序:是的,
dataIndex:“潜在的内部外包”,
弹性:1,
编辑:{
这个梳子
[{'id': 1, 'name': 'test', 'foo': 'bar'}]