Browse Source

Pull request #3419: JSY-26262 & JSY-26289 fix: 修复 multi_select_insert_no_bar_list 部分问题

Merge in VISUAL/fineui from ~RENZO.RUAN/a-fineui-r:master to master

* commit 'd5bcff9a0a87b4d964ed89d5b374792f0dd891bb':
  JSY-26262 fix: 更改布局方式
  JSY-26289 fix: 统一setValue和getValue方法
  JSY-26289 fix: 修复无全选按钮时搜索面板勾选不生效
  JSY-26262 fix: multi_select_insert_no_bar_list 结果为空时,提示居中
research/test
Renzo.Ruan-阮宗伟 2 years ago
parent
commit
4eb0a08651
  1. 14
      src/widget/multiselect/multiselect.loader.nobar.js
  2. 27
      src/widget/multiselect/search/multiselect.search.loader.js

14
src/widget/multiselect/multiselect.loader.nobar.js

@ -98,13 +98,15 @@ BI.MultiSelectNoBarLoader = BI.inherit(BI.Widget, {
value: this.storeValue
}, opts.el));
BI.createWidget({
type: "bi.vertical",
element: this,
items: [this.button_group],
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top), BI.extend({
scrolly: true,
vgap: 5
});
}, opts.logic, {
items: BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top, this.button_group)
}))));
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});

27
src/widget/multiselect/search/multiselect.search.loader.js

@ -134,15 +134,10 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
if (opts.allowSelectAll) {
this.button_group.on(BI.SelectList.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, arguments);
});
} else {
this.button_group.on(BI.ListPane.EVENT_CHANGE, function (val) {
self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, val);
});
}
var searchLoaderEventChangeName = opts.allowSelectAll ? BI.SelectList.EVENT_CHANGE : BI.ListPane.EVENT_CHANGE
this.button_group.on(searchLoaderEventChangeName, function () {
self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE, arguments);
});
},
_createItems: function (items) {
@ -196,13 +191,23 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
},
setValue: function (v) {
v || (v = {});
var o = this.options;
// 暂存的值一定是新的值,不然v改掉后,storeValue也跟着改了
this.storeValue = BI.deepClone(v);
this.button_group.setValue(v);
o.allowSelectAll ? (this.button_group.setValue(v)) : (this.button_group.setValue(v.value));
},
getValue: function () {
return this.button_group.getValue();
var o = this.options;
if (o.allowSelectAll) {
return this.button_group.getValue();
}
return {
type: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
value: this.button_group.getValue(),
assist: this.button_group.getNotSelectedValue()
};
},
getAllButtons: function () {

Loading…
Cancel
Save