diff --git a/demo/js/case/combo/demo.text_value_down_list_combo.js b/demo/js/case/combo/demo.text_value_down_list_combo.js index c89329e8cb..51a8c1a4c5 100644 --- a/demo/js/case/combo/demo.text_value_down_list_combo.js +++ b/demo/js/case/combo/demo.text_value_down_list_combo.js @@ -16,6 +16,8 @@ Demo.TextValueDownListCombo = BI.inherit(BI.Widget, { ref: function (_ref) { self.refs = _ref; }, + text: "默认值", + value: 11, items: [ [{ el: { @@ -35,13 +37,16 @@ Demo.TextValueDownListCombo = BI.inherit(BI.Widget, { value: 3 }] ] + }, { + type: "bi.button", + width: 90, + height: 25, + handler: function () { + self.refs.setValue(2); + } }], vgap: 20 }; - }, - - mounted: function () { - this.refs.setValue(2); } }); diff --git a/dist/bundle.js b/dist/bundle.js index af62bcde34..333b8fc35b 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -68348,10 +68348,16 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); + var value; + if(BI.isNotNull(o.value)){ + value = this._digest(o.value); + } this.trigger = BI.createWidget({ type: "bi.down_list_select_text_trigger", height: o.height, - items: o.items + items: o.items, + text: o.text, + value: value }); this.combo = BI.createWidget({ @@ -68361,6 +68367,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { adjustLength: 2, height: o.height, el: this.trigger, + value: BI.isNull(value) ? [] : [value], items: BI.deepClone(o.items) }); @@ -68389,10 +68396,14 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); }, + _digest: function (v) { + return this.valueMap[v]; + }, + setValue: function (v) { - v = this.valueMap[v]; + v = this._digest(v); this.combo.setValue([v]); - this.trigger.setValue(v.childValue || v.value); + this.trigger.setValue(v); }, getValue: function () { @@ -68432,7 +68443,8 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { element: this, height: o.height, items: this._formatItemArray(o.items), - text: o.text + text: o.text, + value: BI.isNull(o.value) ? "" : o.value.childValue || o.value.value }); }, @@ -68453,7 +68465,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { }, setValue: function (vals) { - this.trigger.setValue(vals); + this.trigger.setValue(vals.childValue || vals.value); }, populate: function (items) { diff --git a/dist/case.js b/dist/case.js index 8d5f138a0c..efcee388e2 100644 --- a/dist/case.js +++ b/dist/case.js @@ -6058,10 +6058,16 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); + var value; + if(BI.isNotNull(o.value)){ + value = this._digest(o.value); + } this.trigger = BI.createWidget({ type: "bi.down_list_select_text_trigger", height: o.height, - items: o.items + items: o.items, + text: o.text, + value: value }); this.combo = BI.createWidget({ @@ -6071,6 +6077,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { adjustLength: 2, height: o.height, el: this.trigger, + value: BI.isNull(value) ? [] : [value], items: BI.deepClone(o.items) }); @@ -6099,10 +6106,14 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); }, + _digest: function (v) { + return this.valueMap[v]; + }, + setValue: function (v) { - v = this.valueMap[v]; + v = this._digest(v); this.combo.setValue([v]); - this.trigger.setValue(v.childValue || v.value); + this.trigger.setValue(v); }, getValue: function () { @@ -6142,7 +6153,8 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { element: this, height: o.height, items: this._formatItemArray(o.items), - text: o.text + text: o.text, + value: BI.isNull(o.value) ? "" : o.value.childValue || o.value.value }); }, @@ -6163,7 +6175,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { }, setValue: function (vals) { - this.trigger.setValue(vals); + this.trigger.setValue(vals.childValue || vals.value); }, populate: function (items) { diff --git a/dist/demo.js b/dist/demo.js index 551376d34e..b92088b3d2 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -1960,6 +1960,8 @@ Demo.TextValueDownListCombo = BI.inherit(BI.Widget, { ref: function (_ref) { self.refs = _ref; }, + text: "默认值", + value: 11, items: [ [{ el: { @@ -1979,13 +1981,16 @@ Demo.TextValueDownListCombo = BI.inherit(BI.Widget, { value: 3 }] ] + }, { + type: "bi.button", + width: 90, + height: 25, + handler: function () { + self.refs.setValue(2); + } }], vgap: 20 }; - }, - - mounted: function () { - this.refs.setValue(2); } }); diff --git a/dist/fineui.js b/dist/fineui.js index 5bec5a6e61..380423b5d1 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -70042,10 +70042,16 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); + var value; + if(BI.isNotNull(o.value)){ + value = this._digest(o.value); + } this.trigger = BI.createWidget({ type: "bi.down_list_select_text_trigger", height: o.height, - items: o.items + items: o.items, + text: o.text, + value: value }); this.combo = BI.createWidget({ @@ -70055,6 +70061,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { adjustLength: 2, height: o.height, el: this.trigger, + value: BI.isNull(value) ? [] : [value], items: BI.deepClone(o.items) }); @@ -70083,10 +70090,14 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); }, + _digest: function (v) { + return this.valueMap[v]; + }, + setValue: function (v) { - v = this.valueMap[v]; + v = this._digest(v); this.combo.setValue([v]); - this.trigger.setValue(v.childValue || v.value); + this.trigger.setValue(v); }, getValue: function () { @@ -70126,7 +70137,8 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { element: this, height: o.height, items: this._formatItemArray(o.items), - text: o.text + text: o.text, + value: BI.isNull(o.value) ? "" : o.value.childValue || o.value.value }); }, @@ -70147,7 +70159,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { }, setValue: function (vals) { - this.trigger.setValue(vals); + this.trigger.setValue(vals.childValue || vals.value); }, populate: function (items) { diff --git a/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js b/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js index cc93917342..ebde1e8f26 100644 --- a/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js +++ b/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js @@ -16,10 +16,16 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); + var value; + if(BI.isNotNull(o.value)){ + value = this._digest(o.value); + } this.trigger = BI.createWidget({ type: "bi.down_list_select_text_trigger", height: o.height, - items: o.items + items: o.items, + text: o.text, + value: value }); this.combo = BI.createWidget({ @@ -29,6 +35,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { adjustLength: 2, height: o.height, el: this.trigger, + value: BI.isNull(value) ? [] : [value], items: BI.deepClone(o.items) }); @@ -57,10 +64,14 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); }, + _digest: function (v) { + return this.valueMap[v]; + }, + setValue: function (v) { - v = this.valueMap[v]; + v = this._digest(v); this.combo.setValue([v]); - this.trigger.setValue(v.childValue || v.value); + this.trigger.setValue(v); }, getValue: function () { diff --git a/src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js b/src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js index a498db3595..b335ce5c1b 100644 --- a/src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js +++ b/src/case/combo/textvaluedownlistcombo/trigger.textvaluedownlist.js @@ -23,7 +23,8 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { element: this, height: o.height, items: this._formatItemArray(o.items), - text: o.text + text: o.text, + value: BI.isNull(o.value) ? "" : o.value.childValue || o.value.value }); }, @@ -44,7 +45,7 @@ BI.DownListSelectTextTrigger = BI.inherit(BI.Trigger, { }, setValue: function (vals) { - this.trigger.setValue(vals); + this.trigger.setValue(vals.childValue || vals.value); }, populate: function (items) {