You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

1.2 KiB

let selectedValues = ["1", "2"];

var Model = BI.inherit(Fix.Model, { state: function () { return { selectedValues: ["1", "2"], } }, computed: { selectedNodes: function () { return this.model.selectedValues; } }, actions: { setSelectedValue: function (v) { this.model.selectedValues = v; } } }) BI.model("demo_chooser_combo", Model);

var model = BI.Models.getModel("demo_chooser_combo");

BI.createWidget({ type: "bi.value_chooser_no_bar_combo", ref: (_ref) => { this.combo = _ref; }, value: model.model.selectedValues, items: [ { text: "11", value: "1", disabled: () => { var isSelected = !!model.model.selectedNodes.find(value => value === "1"); return !isSelected && model.model.selectedNodes.length >= 2; } }, { text: "22", value: "2", disabled: () => { var isSelected = !!model.model.selectedNodes.find(value => value === "2"); return !isSelected && model.model.selectedNodes.length >= 2; } }, { text: "33", value: "3", disabled: () => { var isSelected = !!model.model.selectedNodes.find(value => value === "3"); return !isSelected && model.model.selectedNodes.length >= 2; } } ], listeners: [ { eventName: BI.ValueChooserNoBarCombo.EVENT_CLICK_ITEM, action: () => { const selectedNodesID = this.combo.getValue(); model.setSelectedValue(selectedNodesID); }, } ] });