Browse Source

KERNEL-11422 feat: 给下拉框都添加valueFormatter属性

es6
zsmj 2 years ago
parent
commit
abe1b1989b
  1. 2
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  2. 6
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js

2
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -36,6 +36,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
var baseConfig = this._getBaseConfig();
if (o.allowEdit) {
return {
type: "bi.absolute",
@ -65,6 +66,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
value: o.value,
tipType: o.tipType,
warningTitle: o.warningTitle,
valueFormatter: o.valueFormatter,
}
}, { cls });
},

6
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -181,15 +181,11 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
return o.valueFormatter(v);
}
if (o.itemsCreator === BI.emptyFn) {
var result = BI.find(o.items, function (i, item) {
return item.value === v;
});
return BI.isNotNull(result) ? result.text : o.text;
}
return v;
return BI.isNotNull(result) ? result.text : (o.text ?? v);
},
_getShowText: function () {

Loading…
Cancel
Save