Browse Source

KERNEL-13662 feat: text_value_combo 复选,支持不带全选 - from Richie

es6
zsmj 2 years ago
parent
commit
6006d7bb5c
  1. 23
      demo/js/case/combo/demo.text_value_combo.js
  2. 112
      src/case/combo/textvaluecombo/popup.textvalue.js

23
demo/js/case/combo/demo.text_value_combo.js

@ -209,6 +209,29 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
]
}
]
}),
this.createCombo("支持复选,不要全选功能", {
type: "bi.vertical",
items: [
{
type: "bi.text_value_combo",
width: 300,
items: items,
allowClear: true,
defaultText: "请选择",
chooseType: BI.Selection.Multi,
value: [1],
allowSelectAll: false,
listeners: [
{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action: function () {
console.log(this.getValue());
}
}
]
}
]
})
]
};

112
src/case/combo/textvaluecombo/popup.textvalue.js

@ -45,65 +45,38 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, {
return {
type: "bi.vertical",
verticalAlign: BI.VerticalAlign.Stretch,
rowSize: ["fill", ""],
items: [
items: o.allowSelectAll ? [
{
el: o.allowSelectAll ? {
type: "bi.select_list",
logic: {
dynamic: true,
innerVgap: 5,
rowSize: ["", "fill"],
verticalAlign: BI.VerticalAlign.Stretch
},
ref: (_ref) => {
this.popup = _ref;
},
el: {
el: {
chooseType: o.chooseType,
}
},
items: this._formatItems(o.items),
value: {
type: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
value: o.value
},
listeners: [
{
eventName: BI.SelectList.EVENT_CHANGE,
action: function (val) {
self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val);
}
}
]
} : {
type: "bi.list_pane",
logic: {
dynamic: true,
innerVgap: 5,
rowSize: ["", "fill"],
verticalAlign: BI.VerticalAlign.Stretch
},
ref: (_ref) => {
this.popup = _ref;
},
type: "bi.select_list",
logic: {
dynamic: true,
innerVgap: 5,
rowSize: ["", "fill"],
verticalAlign: BI.VerticalAlign.Stretch
},
ref: (_ref) => {
this.popup = _ref;
},
el: {
el: {
chooseType: o.chooseType,
},
items: this._formatItems(o.items),
value: o.value,
listeners: [
{
eventName: BI.ListPane.EVENT_CHANGE,
action: function (val) {
self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val);
}
}
},
items: this._formatItems(o.items),
value: {
type: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
value: o.value
},
height: "fill",
listeners: [
{
eventName: BI.SelectList.EVENT_CHANGE,
action: function (val) {
self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val);
}
]
}
},
{
}
]
}, {
type: "bi.center",
cls: "list-view-toolbar bi-high-light bi-split-top",
height: 24,
@ -127,7 +100,34 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, {
isShadowShowingOnSelected: true
})
}
]
] : [
{
type: "bi.list_pane",
logic: {
dynamic: true,
innerVgap: 5,
rowSize: ["", "fill"],
verticalAlign: BI.VerticalAlign.Stretch
},
ref: (_ref) => {
this.popup = _ref;
},
el: {
chooseType: o.chooseType,
},
items: this._formatItems(o.items),
value: o.value,
height: "fill",
listeners: [
{
eventName: BI.ListPane.EVENT_CHANGE,
action: function (val) {
self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val);
}
}
]
}
],
};
},

Loading…
Cancel
Save