|
function onGridAfterEdit(editor, params) {
//updateSummary();
var me = this, columnId = params.column.id, rowId = params.record.getId();
if (columnId === 'FQty' || columnId === 'FPrice') {
var itemCateId = me.f_getCellValue(rowId, 'FCateName');
var itemFUnit = me.f_getCellValue(rowId, 'FUnit');
//alert(itemCateId);
if (itemCateId == '气体' && itemFUnit == '瓶') {
var fQty = parseFloat(me.f_getCellValue(rowId, 'FQty'));
me.f_updateCellValue(rowId, 'FBottleQty', fQty);
var fPrice = parseFloat(me.f_getCellValue(rowId, 'FPrice'));
me.f_updateCellValue(rowId, 'FAmount', (fQty * fPrice).toFixed(2)).toFixed(2);
} else {
var fQty = parseFloat(me.f_getCellValue(rowId, 'FQty'));
me.f_updateCellValue(rowId, 'FBottleQty', 0);
var fPrice = parseFloat(me.f_getCellValue(rowId, 'FPrice'));
me.f_updateCellValue(rowId, 'FAmount', (fQty * fPrice).toFixed(2)).toFixed(2);
}
updateSummary();
}
};
function updateSummary() {
// 回发到后台更新
__doPostBack('', 'UPDATE_SUMMARY');
}; |
|