From 1a246b270a6a3e78d5f5b586516c9aa5f0ebbc5e Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 18 Jan 2018 09:55:51 +0800 Subject: [PATCH] =?UTF-8?q?text=5Fvalue=5Fcombo=E6=8E=A5=E5=8F=97value?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/case/combo/demo.text_value_combo.js | 15 +++++++++++++-- dist/bundle.js | 8 ++++---- dist/case.js | 8 ++++---- dist/demo.js | 15 +++++++++++++-- dist/fineui.js | 8 ++++---- src/case/combo/textvaluecombo/combo.textvalue.js | 8 ++++---- 6 files changed, 42 insertions(+), 20 deletions(-) diff --git a/demo/js/case/combo/demo.text_value_combo.js b/demo/js/case/combo/demo.text_value_combo.js index f47b8fd17d..4dcd01630b 100644 --- a/demo/js/case/combo/demo.text_value_combo.js +++ b/demo/js/case/combo/demo.text_value_combo.js @@ -6,12 +6,16 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, { baseCls: "" }, render: function () { - + var combo; return { type: "bi.horizontal_auto", items: [{ type: "bi.text_value_combo", - value: "默认值", + ref: function () { + combo = this; + }, + text: "默认值", + value: 2, width: 300, items: [{ text: "MVC-1", @@ -26,6 +30,13 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, { iconCls: "pull-right-font", value: 3 }] + }, { + type: "bi.button", + width: 90, + height: 25, + handler: function () { + combo.setValue(""); + } }], vgap: 20 }; diff --git a/dist/bundle.js b/dist/bundle.js index 5717c60a2e..e5e0460ff5 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -68151,6 +68151,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { baseClass: "bi-text-value-combo", height: 30, chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, + text: "", value: "", el: {} }); @@ -68163,11 +68164,13 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { type: "bi.select_text_trigger", items: o.items, height: o.height, - text: o.value + text: o.text, + value: o.value }); this.popup = BI.createWidget({ type: "bi.text_value_combo_popup", chooseType: o.chooseType, + value: o.value, items: o.items }); this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () { @@ -68188,9 +68191,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { maxHeight: 300 } }); - if (BI.isKey(o.value)) { - this.setValue(o.value); - } }, setValue: function (v) { diff --git a/dist/case.js b/dist/case.js index 8ad70c5e83..8d5f138a0c 100644 --- a/dist/case.js +++ b/dist/case.js @@ -5861,6 +5861,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { baseClass: "bi-text-value-combo", height: 30, chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, + text: "", value: "", el: {} }); @@ -5873,11 +5874,13 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { type: "bi.select_text_trigger", items: o.items, height: o.height, - text: o.value + text: o.text, + value: o.value }); this.popup = BI.createWidget({ type: "bi.text_value_combo_popup", chooseType: o.chooseType, + value: o.value, items: o.items }); this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () { @@ -5898,9 +5901,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { maxHeight: 300 } }); - if (BI.isKey(o.value)) { - this.setValue(o.value); - } }, setValue: function (v) { diff --git a/dist/demo.js b/dist/demo.js index 2401228fb2..b8f14edbe7 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -1905,12 +1905,16 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, { baseCls: "" }, render: function () { - + var combo; return { type: "bi.horizontal_auto", items: [{ type: "bi.text_value_combo", - value: "默认值", + ref: function () { + combo = this; + }, + text: "默认值", + value: 2, width: 300, items: [{ text: "MVC-1", @@ -1925,6 +1929,13 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, { iconCls: "pull-right-font", value: 3 }] + }, { + type: "bi.button", + width: 90, + height: 25, + handler: function () { + combo.setValue(""); + } }], vgap: 20 }; diff --git a/dist/fineui.js b/dist/fineui.js index b80b774dee..330dc9cdea 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -69845,6 +69845,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { baseClass: "bi-text-value-combo", height: 30, chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, + text: "", value: "", el: {} }); @@ -69857,11 +69858,13 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { type: "bi.select_text_trigger", items: o.items, height: o.height, - text: o.value + text: o.text, + value: o.value }); this.popup = BI.createWidget({ type: "bi.text_value_combo_popup", chooseType: o.chooseType, + value: o.value, items: o.items }); this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () { @@ -69882,9 +69885,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { maxHeight: 300 } }); - if (BI.isKey(o.value)) { - this.setValue(o.value); - } }, setValue: function (v) { diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 4bb31181a8..9470090874 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -10,6 +10,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { baseClass: "bi-text-value-combo", height: 30, chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, + text: "", value: "", el: {} }); @@ -22,11 +23,13 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { type: "bi.select_text_trigger", items: o.items, height: o.height, - text: o.value + text: o.text, + value: o.value }); this.popup = BI.createWidget({ type: "bi.text_value_combo_popup", chooseType: o.chooseType, + value: o.value, items: o.items }); this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE, function () { @@ -47,9 +50,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { maxHeight: 300 } }); - if (BI.isKey(o.value)) { - this.setValue(o.value); - } }, setValue: function (v) {