Skip to content

Commit

Permalink
fix: grid增加onBeforeValueChange处理
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyk committed Nov 29, 2016
1 parent 0a24811 commit be4fee3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/gridCompOperateRow.js
Expand Up @@ -384,6 +384,18 @@ const updateValueAt = function(rowIndex, field, value, force) {
if (typeof value == 'undefined')
value = '';
if (oldValue != value || force) {
if (typeof this.options.onBeforeValueChange == 'function') {
var obj = {};
obj.gridObj = this;
//因为树表更新时候可能改变rowIndex的顺序
obj.rowIndex = treeRowIndex;
obj.field = field;
obj.oldValue = oldValue;
obj.newValue = value;
var flag = this.options.onBeforeValueChange(obj);
if(!flag)
return;
}
$(this.dataSourceObj.rows[rowIndex].value).attr(field, value);
$(this.dataSourceObj.options.values[this.dataSourceObj.rows[rowIndex].valueIndex]).attr(field, value);
if (this.showType == 'grid') {
Expand Down

0 comments on commit be4fee3

Please sign in to comment.