From acf9d3c86309203cb20311a3a8cb507fd774a41e Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 24 Jun 2019 09:52:09 +0800 Subject: [PATCH] REPORT-18332 feat: allowEdit --- src/widget/multiselect/multiselect.combo.js | 4 +++- src/widget/singleselect/singleselect.combo.js | 4 +++- .../singleselect/singleselect.insert.combo.js | 4 +++- src/widget/singleselect/singleselect.trigger.js | 17 ++++++++++++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index de914f337..fc8a893f0 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -13,7 +13,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { height: 24, attributes: { tabIndex: 0 - } + }, + allowEdit: true }); }, @@ -35,6 +36,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", + allowEdit: o.allowEdit, height: o.height, text: o.text, // adapter: this.popup, diff --git a/src/widget/singleselect/singleselect.combo.js b/src/widget/singleselect/singleselect.combo.js index 574a3e23e..9382ff8aa 100644 --- a/src/widget/singleselect/singleselect.combo.js +++ b/src/widget/singleselect/singleselect.combo.js @@ -14,7 +14,8 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { height: 24, attributes: { tabIndex: 0 - } + }, + allowEdit: true }); }, @@ -35,6 +36,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { height: o.height, // adapter: this.popup, allowNoSelect: o.allowNoSelect, + allowEdit: o.allowEdit, valueFormatter: o.valueFormatter, itemsCreator: function (op, callback) { o.itemsCreator(op, function (res) { diff --git a/src/widget/singleselect/singleselect.insert.combo.js b/src/widget/singleselect/singleselect.insert.combo.js index 717ef2e62..dd1218a66 100644 --- a/src/widget/singleselect/singleselect.insert.combo.js +++ b/src/widget/singleselect/singleselect.insert.combo.js @@ -14,7 +14,8 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { height: 24, attributes: { tabIndex: 0 - } + }, + allowEdit: true }); }, @@ -34,6 +35,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { type: "bi.single_select_trigger", height: o.height, allowNoSelect: o.allowNoSelect, + allowEdit: o.allowEdit, // adapter: this.popup, valueFormatter: o.valueFormatter, itemsCreator: function (op, callback) { diff --git a/src/widget/singleselect/singleselect.trigger.js b/src/widget/singleselect/singleselect.trigger.js index 1cdf39aca..06cf1a054 100644 --- a/src/widget/singleselect/singleselect.trigger.js +++ b/src/widget/singleselect/singleselect.trigger.js @@ -23,7 +23,8 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, { switcher: {}, adapter: null, - masker: {} + masker: {}, + allowEdit: true }); }, @@ -75,6 +76,20 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, { width: 24 }] }); + + !o.allowEdit && BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: { + type: "bi.layout" + }, + left: 0, + right: 24, + top: 0, + bottom: 0 + }] + }); }, getSearcher: function () {