Browse Source

feature: 更新下

es6
guy 3 years ago
parent
commit
dd1f7839f9
  1. 2
      src/widget/singleselect/singleselect.combo.js
  2. 2
      src/widget/singleselect/singleselect.insert.combo.js
  3. 10
      src/widget/singleselect/singleselect.loader.js
  4. 2
      src/widget/singleselect/singleselect.popup.view.js
  5. 2
      src/widget/singleselect/singleselectlist.insert.js

2
src/widget/singleselect/singleselect.combo.js

@ -10,6 +10,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
baseCls: "bi-single-select-combo",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
itemWrapper: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true
@ -107,6 +108,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
}
}],
itemsCreator: o.itemsCreator,
itemWrapper: o.itemWrapper,
valueFormatter: o.valueFormatter,
onLoaded: function () {
BI.nextTick(function () {

2
src/widget/singleselect/singleselect.insert.combo.js

@ -10,6 +10,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
baseCls: "bi-single-select-combo",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
itemWrapper: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24,
allowEdit: true,
@ -118,6 +119,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
}
}],
itemsCreator: o.itemsCreator,
itemWrapper: o.itemWrapper,
valueFormatter: o.valueFormatter,
onLoaded: function () {
BI.nextTick(function () {

10
src/widget/singleselect/singleselect.loader.js

@ -22,6 +22,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
allowNoSelect: false,
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
itemWrapper: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
@ -69,7 +70,12 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
if (op.times === 1 && !BI.isUndefined(self.storeValue)) {
var json = BI.map([self.storeValue], function (i, v) {
var txt = opts.valueFormatter(v) || v;
return {
return opts.itemWrapper({
text: txt,
value: v,
title: txt,
selected: true
}) || {
text: txt,
value: v,
title: txt,
@ -117,7 +123,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT,
selected: false,
iconWrapperWidth: 26,
hgap: o.allowNoSelect ? 10 : 0,
textHgap: o.allowNoSelect ? 10 : 0,
title: item.title || item.text
}, item);
});

2
src/widget/singleselect/singleselect.popup.view.js

@ -14,6 +14,7 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
maxHeight: 400,
valueFormatter: BI.emptyFn,
itemsCreator: BI.emptyFn,
itemWrapper: BI.emptyFn,
onLoaded: BI.emptyFn
});
},
@ -26,6 +27,7 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, {
type: "bi.single_select_loader",
allowNoSelect: opts.allowNoSelect,
itemsCreator: opts.itemsCreator,
itemWrapper: opts.itemWrapper,
valueFormatter: opts.valueFormatter,
onLoaded: opts.onLoaded,
value: opts.value

2
src/widget/singleselect/singleselectlist.insert.js

@ -9,6 +9,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
baseCls: "bi-multi-select-insert-list",
allowNoSelect: false,
itemsCreator: BI.emptyFn,
itemWrapper: BI.emptyFn,
valueFormatter: BI.emptyFn,
searcherHeight: 24,
});
@ -30,6 +31,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, {
cls: "popup-single-select-list bi-border-left bi-border-right bi-border-bottom",
itemsCreator: o.itemsCreator,
valueFormatter: o.valueFormatter,
itemWrapper: o.itemWrapper,
logic: {
dynamic: true
},

Loading…
Cancel
Save