Permalink
Browse files

feat: 给row.setValue增加validType判断

  • Loading branch information...
HuYuee committed Jul 7, 2017
1 parent 0f1a94b commit 3e15ca4f9fed8df6657683869123fe55917b8c8f
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/row-data.js
View
@@ -20,7 +20,7 @@ import {
* row.setValue('filed1','value1') // 设置字段值
* row.setValue('filed1','value1','ctx') //设置字段值,同时传入自定义数据
*/
const setValue = function(fieldName, value, ctx, options) {
const setValue = function(fieldName, value, ctx, options, validType) {
if (arguments.length === 1) {
value = fieldName;
@@ -29,7 +29,11 @@ const setValue = function(fieldName, value, ctx, options) {
var oldValue = this.getValue(fieldName)
if (typeof oldValue == 'undefined' || oldValue === null)
oldValue = ''
if (rowUtilFunObj.eq(oldValue, value)) return;
if(validType&&validType==="string"){
if(oldValue===value) return;
}else{
if (rowUtilFunObj.eq(oldValue, value)) return;
}
var event = {
eventType: 'dataTableEvent',
dataTable: this.parent.id,

0 comments on commit 3e15ca4

Please sign in to comment.