Browse Source

Pull request #1577: DEC-15889 fix: 多层级单选树选中效果异常

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '99e5e2f1ca6b241d5d9f095a73717b9925c412e3':
  DEC-15889 fix: 多层级单选树选中效果异常
es6
windy 4 years ago
parent
commit
72448518b0
  1. 7
      src/base/combination/searcher.js
  2. 1
      src/case/tree/treeexpander/tree.expander.js
  3. 4
      src/case/tree/treeexpander/tree.expander.popup.js

7
src/base/combination/searcher.js

@ -101,20 +101,19 @@ BI.Searcher = BI.inherit(BI.Widget, {
if (type === BI.Events.CLICK) {
if (o.isAutoSync) {
var values = o.adapter && o.adapter.getValue();
if (!obj.isSelected()) {
o.adapter && o.adapter.setValue(BI.deepWithout(values, obj.getValue()));
} else {
switch (o.chooseType) {
case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:
o.adapter && o.adapter.setValue([obj.getValue()]);
break;
case BI.ButtonGroup.CHOOSE_TYPE_MULTI:
if (!obj.isSelected()) {
o.adapter && o.adapter.setValue(BI.deepWithout(values, obj.getValue()));
}
values.push(obj.getValue());
o.adapter && o.adapter.setValue(values);
break;
}
}
}
self.fireEvent(BI.Searcher.EVENT_CHANGE, value, obj);
}
});

1
src/case/tree/treeexpander/tree.expander.js

@ -35,6 +35,7 @@
isFirstNode: o.isFirstNode || o.el.isFirstNode,
el: o.popup,
},
value: o.value,
listeners: [
{
eventName: BI.Controller.EVENT_CHANGE,

4
src/case/tree/treeexpander/tree.expander.popup.js

@ -12,7 +12,9 @@
var self = this;
var o = this.options;
this.popupView = BI.createWidget(o.el, this);
this.popupView = BI.createWidget(BI.extend(o.el, {
value: o.value
}), this);
this.popupView.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);

Loading…
Cancel
Save