the new value is not set before the afteredit event is called.
so i attempt to get the new value using:
at the debugger i find that el.value=""
plz help...I know there is new code planned to replace this but i need something in the mean time.
or the new code
so i attempt to get the new value using:
afteredit:function(grid, record, field, row, column){
alert(record.data[field]+"-->");//+ed.getValue());
var cm = grid.getColumnModel();
alert("cm: "+cm);
var ed = cm.getCellEditor(row, column);
alert("ed: "+ed);
debugger;
var value = ed.getValue();
alert("value: "+value);
//alert("-->"+value);
}
plz help...I know there is new code planned to replace this but i need something in the mean time.
or the new code


|
#2
|
|
I added value to the fireEvent. This seems to be a good temporary fix until Jack makes his next release.
Ext.grid.EditorGrid.prototype.onEditComplete = function(ed, value, startValue){
this.editing = false;
ed.un("specialkey", this.onEditorKey, this);
if(value != startValue){
var r = this.dataSource.getAt(ed.row);
var field = this.colModel.getDataIndex(ed.col);
if(this.fireEvent("afteredit", this, r, field, ed.row, ed.col, value) !== false){
r.set(field, value);
}
}
this.view.focusCell(ed.row, ed.col);
};
![]() |
ExtJS Grid 编辑问题
本文探讨了ExtJS Grid编辑完成后获取新值的问题。作者尝试在afterEdit事件中获取新值,但发现此时新值尚未设置。通过修改onEditComplete方法,在事件中传递新值,实现了临时解决方案。
5235

被折叠的 条评论
为什么被折叠?



