Browse Source

KERNEL-552 feat: 复选与树下拉trigger支持是否可编辑

es6
windy 5 years ago
parent
commit
d0b8e240de
  1. 1
      changelog.md
  2. 1
      demo/js/widget/multiselect/demo.multi_select_combo.js
  3. 4
      src/widget/multiselect/multiselect.insert.combo.js
  4. 17
      src/widget/multiselect/multiselect.insert.trigger.js
  5. 17
      src/widget/multiselect/multiselect.trigger.js
  6. 4
      src/widget/multitree/multi.tree.insert.combo.js
  7. 4
      src/widget/multitree/multi.tree.list.combo.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志
2.0(2019-05)
- 复选下拉控件和树下拉控件支持trigger是否可编辑
- 时分秒控件支持自定义时间显示格式和是否可编辑
- 日期/时间/日期区间/时间区间支持自定义日期选择范围和是否可编辑
- 日期/时间/日期区间/时间区间支持自定义日期显示格式和是否可编辑

1
demo/js/widget/multiselect/demo.multi_select_combo.js

@ -10,6 +10,7 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
var self = this;
var widget = BI.createWidget({
type: "bi.multi_select_insert_combo",
// allowEdit: false,
itemsCreator: BI.bind(this._itemsCreator, this),
width: 200,
value: {

4
src/widget/multiselect/multiselect.insert.combo.js

@ -13,7 +13,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
height: 24,
attributes: {
tabIndex: 0
}
},
allowEdit: true
});
},
@ -32,6 +33,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({
type: "bi.multi_select_insert_trigger",
allowEdit: o.allowEdit,
height: o.height,
text: o.text,
// adapter: this.popup,

17
src/widget/multiselect/multiselect.insert.trigger.js

@ -22,7 +22,8 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
switcher: {},
adapter: null,
masker: {}
masker: {},
allowEdit: true
});
},
@ -102,6 +103,20 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
}]
});
!o.allowEdit && BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.layout"
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
wrapper.attr("items")[1].width = (b === true ? self.numberCounter.element.outerWidth() + 8 : 0);

17
src/widget/multiselect/multiselect.trigger.js

@ -22,7 +22,8 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
switcher: {},
adapter: null,
masker: {}
masker: {},
allowEdit: true
});
},
@ -99,6 +100,20 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
}]
});
!o.allowEdit && BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: {
type: "bi.layout"
},
left: 0,
right: 24,
top: 0,
bottom: 0
}]
});
this.numberCounter.on(BI.Events.VIEW, function (b) {
BI.nextTick(function () {// 自动调整宽度
wrapper.attr("items")[1].width = (b === true ? self.numberCounter.element.outerWidth() + 8 : 0);

4
src/widget/multitree/multi.tree.insert.combo.js

@ -20,7 +20,8 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
baseCls: "bi-multi-tree-insert-combo",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24
height: 24,
allowEdit: true
});
},
@ -36,6 +37,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
allowEdit: o.allowEdit,
height: o.height,
valueFormatter: o.valueFormatter,
// adapter: this.popup,

4
src/widget/multitree/multi.tree.list.combo.js

@ -20,7 +20,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
baseCls: "bi-multi-tree-list-combo",
itemsCreator: BI.emptyFn,
valueFormatter: BI.emptyFn,
height: 24
height: 24,
allowEdit: true
});
},
@ -36,6 +37,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
this.trigger = BI.createWidget({
type: "bi.multi_select_trigger",
allowEdit: o.allowEdit,
height: o.height,
valueFormatter: o.valueFormatter,
// adapter: this.popup,

Loading…
Cancel
Save