|
|
@ -52,17 +52,18 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { |
|
|
|
_digest: function (val, items) { |
|
|
|
_digest: function (val, items) { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
|
|
|
|
// 提升valueFormatter的优先级
|
|
|
|
|
|
|
|
if (o.valueFormatter !== BI.emptyFn && BI.isFunction(o.valueFormatter)) { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
text: o.valueFormatter(val), |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val = BI.isArray(val) ? val.slice() : [val]; |
|
|
|
val = BI.isArray(val) ? val.slice() : [val]; |
|
|
|
|
|
|
|
|
|
|
|
var result = []; |
|
|
|
var result = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 提升valueFormatter的优先级
|
|
|
|
|
|
|
|
if (o.valueFormatter !== BI.emptyFn && BI.isFunction(o.valueFormatter)) { |
|
|
|
|
|
|
|
BI.each(val, function (index, v) { |
|
|
|
|
|
|
|
result.push(o.valueFormatter(v)); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return result.join(","); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var formatItems = BI.Tree.transformToArrayFormat(items); |
|
|
|
var formatItems = BI.Tree.transformToArrayFormat(items); |
|
|
|
BI.each(formatItems, function (i, item) { |
|
|
|
BI.each(formatItems, function (i, item) { |
|
|
|
if (BI.contains(val, item.value) && !BI.contains(result, item.text || item.value)) { |
|
|
|
if (BI.contains(val, item.value) && !BI.contains(result, item.text || item.value)) { |
|
|
|