自动计算
通过书写代码,监听事件,实现自动计算。
本例文件位置:安装目录\YZSoft\request\forms\Expense.js。
体验:应用模块->发起申请->报销。
代码:
listeners: {
scope: me,
keyup: 'updateAmount'
}
listeners: {
scope:me,
delete: 'updateAmount'
}
updateAmount: function () {
var me = this,
fields = me.getFields(),
formData = me.$getFormData().FormData
amount = 0;
Ext.each(formData.iDemoExpenseDetail, function (row) {
amount += row.Amount || 0;
});
fields.amount.setValue(amount);
}
Created with the Personal Edition of HelpNDoc: Easily create Web Help sites