diff --git a/changelog.md b/changelog.md index bef9a247c0..aeab84ac22 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-06) +- 下拉树系列支持isNeedAdjustWidth以动态变化宽度 - 修复了新增值的下拉控件传递valueFormatter搜索完全匹配项提示新增 - 修复了选色控件历史记录没有选中的问题的问题 - 修复了单选下拉框新增值的时候没有发事件的问题 diff --git a/src/component/treevaluechooser/combo.listtreevaluechooser.js b/src/component/treevaluechooser/combo.listtreevaluechooser.js index 4286b9cd7f..7fa35c6cf6 100644 --- a/src/component/treevaluechooser/combo.listtreevaluechooser.js +++ b/src/component/treevaluechooser/combo.listtreevaluechooser.js @@ -13,7 +13,8 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, width: 200, height: 24, items: null, - itemsCreator: BI.emptyFn + itemsCreator: BI.emptyFn, + isNeedAdjustWidth: true, }); }, @@ -25,6 +26,7 @@ BI.ListTreeValueChooserInsertCombo = BI.inherit(BI.AbstractListTreeValueChooser, } this.combo = BI.createWidget({ type: "bi.multi_tree_list_combo", + isNeedAdjustWidth: o.isNeedAdjustWidth, element: this, text: o.text, value: o.value, diff --git a/src/component/treevaluechooser/combo.treevaluechooser.insert.js b/src/component/treevaluechooser/combo.treevaluechooser.insert.js index 3527c5d3a2..5ef51011c8 100644 --- a/src/component/treevaluechooser/combo.treevaluechooser.insert.js +++ b/src/component/treevaluechooser/combo.treevaluechooser.insert.js @@ -13,7 +13,8 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, { width: 200, height: 24, items: null, - itemsCreator: BI.emptyFn + itemsCreator: BI.emptyFn, + isNeedAdjustWidth: true }); }, @@ -25,6 +26,7 @@ BI.TreeValueChooserInsertCombo = BI.inherit(BI.AbstractTreeValueChooser, { } this.combo = BI.createWidget({ type: "bi.multi_tree_insert_combo", + isNeedAdjustWidth: o.isNeedAdjustWidth, allowEdit: o.allowEdit, text: o.text, value: o.value, diff --git a/src/component/treevaluechooser/combo.treevaluechooser.js b/src/component/treevaluechooser/combo.treevaluechooser.js index a859fed0ff..99ccfbbf71 100644 --- a/src/component/treevaluechooser/combo.treevaluechooser.js +++ b/src/component/treevaluechooser/combo.treevaluechooser.js @@ -13,7 +13,8 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { width: 200, height: 24, items: null, - itemsCreator: BI.emptyFn + itemsCreator: BI.emptyFn, + isNeedAdjustWidth: true }); }, @@ -34,6 +35,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, { valueFormatter: BI.bind(this._valueFormatter, this), width: o.width, height: o.height, + isNeedAdjustWidth: o.isNeedAdjustWidth, listeners: [{ eventName: BI.MultiTreeCombo.EVENT_FOCUS, action: function () { diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index fbfec93806..fd47795728 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -18,7 +18,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }, allowEdit: false, allowSearchValue: false, - allowInsertValue: false + allowInsertValue: false, + isNeedAdjustWidth: true }); }, @@ -95,8 +96,10 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }, value: o.value, maxHeight: 400, + maxWidth: o.isNeedAdjustWidth ? "auto" : 500, minHeight: 240 }, + isNeedAdjustWidth: o.isNeedAdjustWidth, listeners: [{ eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, action: function () { diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 5534e27acd..5cf34118dc 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -21,7 +21,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }, allowEdit: false, allowSearchValue: false, - allowInsertValue: false + allowInsertValue: false, + isNeedAdjustWidth: true }); }, @@ -98,8 +99,10 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }, value: o.value, maxHeight: 400, + maxWidth: o.isNeedAdjustWidth ? "auto" : 500, minHeight: 240 }, + isNeedAdjustWidth: o.isNeedAdjustWidth, listeners: [{ eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, action: function () { diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index 97b28d492e..e431d918d0 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/src/widget/multitree/multi.tree.combo.js @@ -21,7 +21,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + isNeedAdjustWidth: true, }); }, @@ -106,8 +107,10 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { self.numberCounter.adjustView(); self.trigger.getSearcher().adjustView(); }); - } + }, + maxWidth: o.isNeedAdjustWidth ? "auto" : 500, }, + isNeedAdjustWidth: o.isNeedAdjustWidth, value: {value: o.value || {}}, hideChecker: function (e) { return triggerBtn.element.find(e.target).length === 0 && diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js index e005b80977..b441760394 100644 --- a/src/widget/multitree/multi.tree.insert.combo.js +++ b/src/widget/multitree/multi.tree.insert.combo.js @@ -21,7 +21,8 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { itemsCreator: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, - allowEdit: true + allowEdit: true, + isNeedAdjustWidth: true }); }, @@ -121,8 +122,10 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { self.numberCounter.adjustView(); self.trigger.getSearcher().adjustView(); }); - } + }, + maxWidth: o.isNeedAdjustWidth ? "auto" : 500, }, + isNeedAdjustWidth: o.isNeedAdjustWidth, value: {value: o.value || {}}, hideChecker: function (e) { return triggerBtn.element.find(e.target).length === 0 && diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js index 31fb9893da..72ba8966de 100644 --- a/src/widget/multitree/multi.tree.list.combo.js +++ b/src/widget/multitree/multi.tree.list.combo.js @@ -22,7 +22,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { valueFormatter: BI.emptyFn, height: 24, allowEdit: true, - allowInsertValue: true + allowInsertValue: true, + isNeedAdjustWidth: true }); }, @@ -140,8 +141,10 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, { self.numberCounter.adjustView(); self.trigger.getSearcher().adjustView(); }); - } + }, + maxWidth: o.isNeedAdjustWidth ? "auto" : 500, }, + isNeedAdjustWidth: o.isNeedAdjustWidth, value: {value: o.value || {}}, hideChecker: function (e) { return triggerBtn.element.find(e.target).length === 0 &&