在grid 里添加了两个 Listener , 但是只有onGridBeforeEdit 可以触发成功,onGridAfterEdit 没法触发成功,
不清楚什么原因?
<Listeners>
<fistener Event="afteredit" Handler="onGridAfterEdit" />
<fistener Event="beforeedit" Handler="onGridBeforeEdit" />
</Listeners>
function onGridAfterEdit(event, value, params) {
alert('AfterEdit')
var me = this, columnId = params.columnId, rowId = params.rowId;
if (columnId === 'Name' || columnId === 'MathScore') {
// var chineseScore = me.getCellValue(rowId, 'ChineseScore');
var mathScore = me.getCellValue(rowId, 'Title');
alert(mathScore);
// me.updateCellValue(rowId, 'TotalScore', chineseScore + mathScore);
// updateSummary(me);
}
}
function onGridBeforeEdit(event, value, params) {
alert('BeforeEdit')
// 取消单元格编辑
// if (params.td.hasClass('custom-cell-no-edit')) {
// return false;
// }
return true;
}
|