Browse Source

修改下mulritextvaluecombo

es6
windy 6 years ago
parent
commit
0fbeaaa27e
  1. 13
      demo/js/case/combo/demo.search_text_value_combo.js
  2. 16
      dist/bundle.js
  3. 13
      dist/demo.js
  4. 16
      dist/fineui.js
  5. 16
      dist/widget.js
  6. 16
      src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js

13
demo/js/case/combo/demo.search_text_value_combo.js

@ -6,7 +6,7 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
var combo, searchCombo;
return {
type: "bi.horizontal_auto",
items: [{
@ -67,6 +67,9 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
value: {
type: 1,
value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"]
},
ref: function () {
searchCombo = this;
}
}, {
type: "bi.button",
@ -76,6 +79,14 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
handler: function () {
combo.setValue(11);
}
}, {
type: "bi.button",
text: "getValue()",
width: 90,
height: 25,
handler: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}],
vgap: 20
};

16
dist/bundle.js vendored

@ -104552,7 +104552,11 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
},
setValue: function (v) {
this.storeValue = BI.deepClone(v || {});
var obj = {
type: BI.Selection.Multi,
value: v || []
};
this.storeValue = BI.deepClone(obj);
this._updateAllValue();
this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue);
@ -104560,7 +104564,15 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
},
getValue: function () {
return BI.deepClone(this.storeValue);
var obj = BI.deepClone(this.storeValue), self = this;
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(self.storeValue.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value;
},
_populate: function () {

13
dist/demo.js vendored

@ -2077,7 +2077,7 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
baseCls: ""
},
render: function () {
var combo;
var combo, searchCombo;
return {
type: "bi.horizontal_auto",
items: [{
@ -2138,6 +2138,9 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
value: {
type: 1,
value: ["1", "2", "柳州市城贸金属材料有限责任公司", "3"]
},
ref: function () {
searchCombo = this;
}
}, {
type: "bi.button",
@ -2147,6 +2150,14 @@ Demo.SearchTextValueCombo = BI.inherit(BI.Widget, {
handler: function () {
combo.setValue(11);
}
}, {
type: "bi.button",
text: "getValue()",
width: 90,
height: 25,
handler: function () {
BI.Msg.toast(JSON.stringify(searchCombo.getValue()));
}
}],
vgap: 20
};

16
dist/fineui.js vendored

@ -104801,7 +104801,11 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
},
setValue: function (v) {
this.storeValue = BI.deepClone(v || {});
var obj = {
type: BI.Selection.Multi,
value: v || []
};
this.storeValue = BI.deepClone(obj);
this._updateAllValue();
this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue);
@ -104809,7 +104813,15 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
},
getValue: function () {
return BI.deepClone(this.storeValue);
var obj = BI.deepClone(this.storeValue), self = this;
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(self.storeValue.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value;
},
_populate: function () {

16
dist/widget.js vendored

@ -16549,7 +16549,11 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
},
setValue: function (v) {
this.storeValue = BI.deepClone(v || {});
var obj = {
type: BI.Selection.Multi,
value: v || []
};
this.storeValue = BI.deepClone(obj);
this._updateAllValue();
this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue);
@ -16557,7 +16561,15 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
},
getValue: function () {
return BI.deepClone(this.storeValue);
var obj = BI.deepClone(this.storeValue), self = this;
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(self.storeValue.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value;
},
_populate: function () {

16
src/widget/searchmultitextvaluecombo/multitextvalue.combo.search.js

@ -442,7 +442,11 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
},
setValue: function (v) {
this.storeValue = BI.deepClone(v || {});
var obj = {
type: BI.Selection.Multi,
value: v || []
};
this.storeValue = BI.deepClone(obj);
this._updateAllValue();
this._assertValue(this.storeValue);
this.combo.setValue(this.storeValue);
@ -450,7 +454,15 @@ BI.SearchMultiTextValueCombo = BI.inherit(BI.Single, {
},
getValue: function () {
return BI.deepClone(this.storeValue);
var obj = BI.deepClone(this.storeValue), self = this;
if(obj.type === BI.Selection.All) {
var values = [];
BI.each(this.options.items, function (idx, item) {
!BI.contains(self.storeValue.value, item.value) && values.push(item.value);
});
return values;
}
return obj.value;
},
_populate: function () {

Loading…
Cancel
Save