Browse Source

REPORT-18484 feat: 复选下拉添加事件

es6
windy 5 years ago
parent
commit
06f2b85b8e
  1. 2
      src/base/single/button/buttons/button.icon.js
  2. 18
      src/widget/multilayerselecttree/multilayerselecttree.combo.js
  3. 21
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  4. 18
      src/widget/multilayersingletree/multilayersingletree.combo.js
  5. 20
      src/widget/multilayersingletree/multilayersingletree.trigger.js
  6. 16
      src/widget/multiselect/multiselect.combo.js
  7. 16
      src/widget/multiselect/multiselect.insert.combo.js
  8. 8
      src/widget/multiselect/multiselect.insert.trigger.js
  9. 8
      src/widget/multiselect/multiselect.trigger.js
  10. 10
      src/widget/multiselect/trigger/editor.multiselect.js
  11. 15
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  12. 15
      src/widget/multiselect/trigger/searcher.multiselect.js
  13. 19
      src/widget/multitree/multi.tree.combo.js
  14. 19
      src/widget/multitree/multi.tree.insert.combo.js
  15. 19
      src/widget/multitree/multi.tree.list.combo.js
  16. 18
      src/widget/multitree/trigger/searcher.multi.tree.js
  17. 15
      src/widget/singleselect/singleselect.combo.js
  18. 15
      src/widget/singleselect/singleselect.insert.combo.js
  19. 8
      src/widget/singleselect/singleselect.trigger.js
  20. 10
      src/widget/singleselect/trigger/editor.singleselect.js
  21. 15
      src/widget/singleselect/trigger/searcher.singleselect.js

2
src/base/single/button/buttons/button.icon.js

@ -48,5 +48,5 @@ BI.IconButton = BI.inherit(BI.BasicButton, {
}
}
});
BI.IconButton.EVENT_CHANGE = "EVENT_CHANGE";
BI.IconButton.EVENT_CHANGE = "IconButton.EVENT_CHANGE";
BI.shortcut("bi.icon_button", BI.IconButton);

18
src/widget/multilayerselecttree/multilayerselecttree.combo.js

@ -129,6 +129,21 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
self.combo.hideView();
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE);
}
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING);
}
}]
},
hideChecker: function (e) {
@ -157,5 +172,8 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
}
});
BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo);

21
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -32,7 +32,23 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
text: this._digest(o.value),
value: o.value,
height: o.height,
tipText: ""
tipText: "",
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS);
}
}, {
eventName: BI.StateEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_BLUR);
}
}, {
eventName: BI.StateEditor.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING);
}
}]
},
popup: {
type: "bi.multilayer_select_tree_popup",
@ -116,6 +132,9 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
return this.searcher.getValue();
}
});
BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSelectTreeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSelectTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSelectTreeTrigger.EVENT_START = "EVENT_START";

18
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -132,6 +132,21 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.combo.hideView();
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE);
}
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_FOCUS);
}
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BLUR);
}
}, {
eventName: BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING);
}
}]
},
hideChecker: function (e) {
@ -160,5 +175,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
}
});
BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multilayer_single_tree_combo", BI.MultiLayerSingleTreeCombo);

20
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -32,7 +32,23 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
text: this._digest(o.value),
value: o.value,
height: o.height,
tipText: ""
tipText: "",
listeners: [{
eventName: BI.StateEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS);
}
}, {
eventName: BI.StateEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_BLUR);
}
}, {
eventName: BI.StateEditor.EVENT_CHANGE,
action: function () {
self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING);
}
}]
},
popup: {
type: "bi.multilayer_single_tree_popup",
@ -116,6 +132,8 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
return this.searcher.getValue();
}
});
BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiLayerSingleTreeTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiLayerSingleTreeTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiLayerSingleTreeTrigger.EVENT_START = "EVENT_START";

16
src/widget/multiselect/multiselect.combo.js

@ -61,12 +61,20 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
value: this.storeValue
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self._setStartValue("");
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self._setStartValue("");
self.fireEvent(BI.MultiSelectCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
@ -99,6 +107,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
}
});
}
self.fireEvent(BI.MultiSelectCombo.EVENT_SEARCHING);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE, function (value, obj) {
@ -111,6 +120,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
assertShowValue();
});
}
self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
this.getCounter().setValue(self.storeValue);
@ -140,6 +150,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self._adjust(function () {
assertShowValue();
});
self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
@ -365,6 +376,11 @@ BI.extend(BI.MultiSelectCombo, {
REQ_GET_ALL_DATA: -1
});
BI.MultiSelectCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiSelectCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiSelectCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.multi_select_combo", BI.MultiSelectCombo);

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

@ -58,12 +58,20 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
value: o.value
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START, function () {
self._setStartValue("");
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP, function () {
self._setStartValue("");
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
@ -92,6 +100,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
});
}
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_SEARCHING);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE, function (value, obj) {
@ -104,6 +113,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
assertShowValue();
});
}
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM);
});
this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW, function () {
this.getCounter().setValue(self.storeValue);
@ -133,6 +143,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
self._adjust(function () {
assertShowValue();
});
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,
@ -378,6 +389,11 @@ BI.extend(BI.MultiSelectInsertCombo, {
REQ_GET_ALL_DATA: -1
});
BI.MultiSelectInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiSelectInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.multi_select_insert_combo", BI.MultiSelectInsertCombo);

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

@ -64,6 +64,12 @@ BI.MultiSelectInsertTrigger = BI.inherit(BI.Trigger, {
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_BLUR);
});
this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_FOCUS);
});
this.numberCounter = BI.createWidget(o.switcher, {
type: "bi.multi_select_check_selected_switcher",
valueFormatter: o.valueFormatter,
@ -172,5 +178,7 @@ BI.MultiSelectInsertTrigger.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectInsertTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW = "EVENT_BEFORE_COUNTER_POPUPVIEW";
BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiSelectInsertTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectInsertTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.multi_select_insert_trigger", BI.MultiSelectInsertTrigger);

8
src/widget/multiselect/multiselect.trigger.js

@ -61,6 +61,12 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
this.searcher.on(BI.MultiSelectSearcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_BLUR);
});
this.searcher.on(BI.MultiSelectSearcher.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectTrigger.EVENT_FOCUS);
});
this.numberCounter = BI.createWidget(o.switcher, {
type: "bi.multi_select_check_selected_switcher",
valueFormatter: o.valueFormatter,
@ -168,5 +174,7 @@ BI.MultiSelectTrigger.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectTrigger.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW = "EVENT_BEFORE_COUNTER_POPUPVIEW";
BI.MultiSelectTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.MultiSelectTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.multi_select_trigger", BI.MultiSelectTrigger);

10
src/widget/multiselect/trigger/editor.multiselect.js

@ -35,8 +35,11 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
this.editor.on(BI.StateEditor.EVENT_PAUSE, function () {
self.fireEvent(BI.MultiSelectEditor.EVENT_PAUSE);
});
this.editor.on(BI.StateEditor.EVENT_CLICK_LABEL, function () {
this.editor.on(BI.StateEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiSelectEditor.EVENT_FOCUS);
});
this.editor.on(BI.StateEditor.EVENT_BLUR, function () {
self.fireEvent(BI.MultiSelectEditor.EVENT_BLUR);
});
},
@ -82,5 +85,8 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
}
});
BI.MultiSelectEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectEditor.EVENT_BLUR = "EVENT_BLUR";
BI.MultiSelectEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut("bi.multi_select_editor", BI.MultiSelectEditor);

15
src/widget/multiselect/trigger/searcher.multiselect.insert.js

@ -25,7 +25,18 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
height: o.height,
text: o.text
text: o.text,
listeners: [{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_BLUR);
}
}]
});
this.searcher = BI.createWidget({
@ -179,4 +190,6 @@ BI.MultiSelectInsertSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectInsertSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectInsertSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
BI.MultiSelectInsertSearcher.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectInsertSearcher.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.multi_select_insert_searcher", BI.MultiSelectInsertSearcher);

15
src/widget/multiselect/trigger/searcher.multiselect.js

@ -25,7 +25,18 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
this.editor = BI.createWidget(o.el, {
type: "bi.multi_select_editor",
height: o.height,
text: o.text
text: o.text,
listeners: [{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR);
}
}]
});
this.searcher = BI.createWidget({
@ -172,4 +183,6 @@ BI.MultiSelectSearcher.EVENT_START = "EVENT_START";
BI.MultiSelectSearcher.EVENT_STOP = "EVENT_STOP";
BI.MultiSelectSearcher.EVENT_PAUSE = "EVENT_PAUSE";
BI.MultiSelectSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiSelectSearcher.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiSelectSearcher.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.multi_select_searcher", BI.MultiSelectSearcher);

19
src/widget/multitree/multi.tree.combo.js

@ -90,6 +90,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
};
self.trigger.getSearcher().setState(val);
self.trigger.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
@ -129,6 +130,13 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
return self.combo.isViewVisible();
};
this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiTreeCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiTreeCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()};
this.setValue(self.storeValue);
@ -141,6 +149,11 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
self.combo.populate();
}
});
self.fireEvent(BI.MultiTreeCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function () {
self.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING);
});
function showCounter () {
@ -178,6 +191,7 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
};
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
this.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM);
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -263,6 +277,11 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
}
});
BI.MultiTreeCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiTreeCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiTreeCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiTreeCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.multi_tree_combo", BI.MultiTreeCombo);

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

@ -106,6 +106,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
};
self.trigger.getSearcher().setState(val);
self.trigger.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
@ -145,6 +146,13 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
return self.combo.isViewVisible();
};
this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()};
this.setValue(self.storeValue);
@ -157,6 +165,11 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self.combo.populate();
}
});
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function () {
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_SEARCHING);
});
function showCounter () {
@ -194,6 +207,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
};
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
this.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM);
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -284,6 +298,11 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
}
});
BI.MultiTreeInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiTreeInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiTreeInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiTreeInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.multi_tree_insert_combo", BI.MultiTreeInsertCombo);

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

@ -115,6 +115,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
};
self.trigger.getSearcher().setState(val);
self.trigger.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM);
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
@ -154,6 +155,13 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
return self.combo.isViewVisible();
};
this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.MultiTreeListCombo.EVENT_FOCUS);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.MultiTreeListCombo.EVENT_BLUR);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()};
this.setValue(self.storeValue);
@ -166,6 +174,11 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
self.combo.populate();
}
});
self.fireEvent(BI.MultiTreeListCombo.EVENT_STOP);
});
this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING, function () {
self.fireEvent(BI.MultiTreeListCombo.EVENT_SEARCHING);
});
function showCounter () {
@ -203,6 +216,7 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
};
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
this.getCounter().setButtonChecked(val);
self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM);
});
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () {
@ -293,6 +307,11 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
}
});
BI.MultiTreeListCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.MultiTreeListCombo.EVENT_BLUR = "EVENT_BLUR";
BI.MultiTreeListCombo.EVENT_STOP = "EVENT_STOP";
BI.MultiTreeListCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.MultiTreeListCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeListCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.multi_tree_list_combo", BI.MultiTreeListCombo);

18
src/widget/multitree/trigger/searcher.multi.tree.js

@ -30,7 +30,18 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
type: "bi.simple_state_editor",
text: o.text,
height: o.height
}
},
listeners: [{
eventName: BI.MultiSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.MultiSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR);
}
}]
});
this.searcher = BI.createWidget({
@ -75,6 +86,10 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
this.searcher.on(BI.Searcher.EVENT_CHANGE, function () {
self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.Searcher.EVENT_SEARCHING, function () {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiTreeSearcher.EVENT_SEARCHING, keywords);
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
}
@ -167,6 +182,7 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
}
});
BI.MultiTreeSearcher.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.MultiTreeSearcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.MultiTreeSearcher.EVENT_START = "EVENT_START";

15
src/widget/singleselect/singleselect.combo.js

@ -51,12 +51,20 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
value: this.storeValue
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.SingleSelectCombo.EVENT_FOCUS);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.SingleSelectCombo.EVENT_BLUR);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_START, function () {
self._setStartValue();
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP, function () {
self._setStartValue();
self.fireEvent(BI.SingleSelectCombo.EVENT_STOP);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE, function () {
if (this.getSearcher().hasMatched()) {
@ -84,6 +92,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
}
});
}
self.fireEvent(BI.SingleSelectCombo.EVENT_SEARCHING);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE, function (value, obj) {
@ -118,6 +127,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
assertShowValue();
self._defaultState();
});
self.fireEvent(BI.SingleSelectCombo.EVENT_CLICK_ITEM);
}
}],
itemsCreator: o.itemsCreator,
@ -270,6 +280,11 @@ BI.extend(BI.SingleSelectCombo, {
REQ_GET_ALL_DATA: -1
});
BI.SingleSelectCombo.EVENT_BLUR = "EVENT_BLUR";
BI.SingleSelectCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectCombo.EVENT_STOP = "EVENT_STOP";
BI.SingleSelectCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SingleSelectCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.SingleSelectCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.single_select_combo", BI.SingleSelectCombo);

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

@ -66,12 +66,20 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
}
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS, function () {
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_FOCUS);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR, function () {
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_BLUR);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_START, function () {
self._setStartValue();
this.getSearcher().setValue(self.storeValue);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP, function () {
self._setStartValue();
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_STOP);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE, function () {
var keyword = this.getSearcher().getKeyword();
@ -98,6 +106,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
}
});
}
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_SEARCHING);
});
this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE, function (value, obj) {
@ -132,6 +141,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, {
assertShowValue();
self._defaultState();
});
self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM);
}
}],
itemsCreator: o.itemsCreator,
@ -273,6 +283,11 @@ BI.extend(BI.SingleSelectInsertCombo, {
REQ_GET_ALL_DATA: -1
});
BI.SingleSelectInsertCombo.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectInsertCombo.EVENT_BLUR = "EVENT_BLUR";
BI.SingleSelectInsertCombo.EVENT_STOP = "EVENT_STOP";
BI.SingleSelectInsertCombo.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo);

8
src/widget/singleselect/singleselect.trigger.js

@ -63,6 +63,12 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, {
this.searcher.on(BI.SingleSelectSearcher.EVENT_CHANGE, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_CHANGE, arguments);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_FOCUS, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_FOCUS);
});
this.searcher.on(BI.SingleSelectSearcher.EVENT_BLUR, function () {
self.fireEvent(BI.SingleSelectTrigger.EVENT_BLUR, arguments);
});
var wrapper = BI.createWidget({
type: "bi.htape",
@ -125,5 +131,7 @@ BI.SingleSelectTrigger.EVENT_STOP = "EVENT_STOP";
BI.SingleSelectTrigger.EVENT_PAUSE = "EVENT_PAUSE";
BI.SingleSelectTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SingleSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW = "EVENT_BEFORE_COUNTER_POPUPVIEW";
BI.SingleSelectTrigger.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectTrigger.EVENT_BLUR = "EVENT_BLUR";
BI.shortcut("bi.single_select_trigger", BI.SingleSelectTrigger);

10
src/widget/singleselect/trigger/editor.singleselect.js

@ -33,8 +33,11 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
this.editor.on(BI.StateEditor.EVENT_PAUSE, function () {
self.fireEvent(BI.SingleSelectEditor.EVENT_PAUSE);
});
this.editor.on(BI.StateEditor.EVENT_CLICK_LABEL, function () {
this.editor.on(BI.StateEditor.EVENT_FOCUS, function () {
self.fireEvent(BI.SingleSelectEditor.EVENT_FOCUS);
});
this.editor.on(BI.StateEditor.EVENT_BLUR, function () {
self.fireEvent(BI.SingleSelectEditor.EVENT_BLUR);
});
},
@ -76,5 +79,8 @@ BI.SingleSelectEditor = BI.inherit(BI.Widget, {
}
});
BI.SingleSelectEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectEditor.EVENT_BLUR = "EVENT_BLUR";
BI.SingleSelectEditor.EVENT_PAUSE = "EVENT_PAUSE";
BI.shortcut("bi.single_select_editor", BI.SingleSelectEditor);

15
src/widget/singleselect/trigger/searcher.singleselect.js

@ -25,7 +25,18 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
this.editor = BI.createWidget(o.el, {
type: "bi.single_select_editor",
height: o.height,
text: o.text
text: o.text,
listeners: [{
eventName: BI.SingleSelectEditor.EVENT_FOCUS,
action: function () {
self.fireEvent(BI.SingleSelectSearcher.EVENT_FOCUS);
}
}, {
eventName: BI.SingleSelectEditor.EVENT_BLUR,
action: function () {
self.fireEvent(BI.SingleSelectSearcher.EVENT_BLUR);
}
}]
});
this.searcher = BI.createWidget({
@ -138,6 +149,8 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
}
});
BI.SingleSelectSearcher.EVENT_FOCUS = "EVENT_FOCUS";
BI.SingleSelectSearcher.EVENT_BLUR = "EVENT_BLUR";
BI.SingleSelectSearcher.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW";
BI.SingleSelectSearcher.EVENT_CHANGE = "EVENT_CHANGE";
BI.SingleSelectSearcher.EVENT_START = "EVENT_START";

Loading…
Cancel
Save