extjs中记录表单插件中的ok按钮
如何获取更新的记录,我正在重写on Ok函数以将更改保存到表单中。 1.我只是覆盖了on ok功能,但无法获得修改后的记录extjs中记录表单插件中的ok按钮,extjs,Extjs,如何获取更新的记录,我正在重写on Ok函数以将更改保存到表单中。 1.我只是覆盖了on ok功能,但无法获得修改后的记录 Ext.override(Ext.ux.grid.RecordForm , { onOK:function() { updateRecord1(); } }); function updateRecord1() {//alert('record'); var records =store.getModifiedRecord
Ext.override(Ext.ux.grid.RecordForm , {
onOK:function() {
updateRecord1();
}
});
function updateRecord1() {//alert('record');
var records =store.getModifiedRecords();
if(!records.length) {
return;
}
var data = [];
Ext.each(records, function(r, i) {
var o = r.getChanges();
if(r.data.newRecord) {
o.newRecord = true;
}
o[idName] = r.get(idName);
data.push(o);
});
var o = {
url:gl_acc.php
,method:'post'
,params:{
record:record.get('id'),
task:'update'
}
};
Ext.Ajax.request(o);
} // eo function commitChanges
var records=this.store.getModifiedRecords()代码>我正在用extjs中的saki重写record form插件的onok函数,我无法获取更新后的记录。我快速查看了源代码,似乎要获取存储,您需要通过this.store
或this.grid.store
来引用它。除非您有一个名为store
的全局变量,调用store.getModifiedRecords()代码>不会做任何事情(除了引发异常)耶…当我尝试提醒记录时。长度显示为零。这就是我想知道如何获取更新的记录