From 06f2b85b8e4f87a34167bdc03f963f6051eca613 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 24 Jun 2019 16:31:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-18484=20feat:=20=E5=A4=8D=E9=80=89?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=B7=BB=E5=8A=A0=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/buttons/button.icon.js | 2 +- .../multilayerselecttree.combo.js | 18 ++++++++++++++++ .../multilayerselecttree.trigger.js | 21 ++++++++++++++++++- .../multilayersingletree.combo.js | 18 ++++++++++++++++ .../multilayersingletree.trigger.js | 20 +++++++++++++++++- src/widget/multiselect/multiselect.combo.js | 16 ++++++++++++++ .../multiselect/multiselect.insert.combo.js | 16 ++++++++++++++ .../multiselect/multiselect.insert.trigger.js | 8 +++++++ src/widget/multiselect/multiselect.trigger.js | 8 +++++++ .../multiselect/trigger/editor.multiselect.js | 10 +++++++-- .../trigger/searcher.multiselect.insert.js | 15 ++++++++++++- .../trigger/searcher.multiselect.js | 15 ++++++++++++- src/widget/multitree/multi.tree.combo.js | 19 +++++++++++++++++ .../multitree/multi.tree.insert.combo.js | 19 +++++++++++++++++ src/widget/multitree/multi.tree.list.combo.js | 19 +++++++++++++++++ .../multitree/trigger/searcher.multi.tree.js | 18 +++++++++++++++- src/widget/singleselect/singleselect.combo.js | 15 +++++++++++++ .../singleselect/singleselect.insert.combo.js | 15 +++++++++++++ .../singleselect/singleselect.trigger.js | 8 +++++++ .../trigger/editor.singleselect.js | 10 +++++++-- .../trigger/searcher.singleselect.js | 15 ++++++++++++- 21 files changed, 294 insertions(+), 11 deletions(-) diff --git a/src/base/single/button/buttons/button.icon.js b/src/base/single/button/buttons/button.icon.js index 62f9a5bd0..ec059e8bc 100644 --- a/src/base/single/button/buttons/button.icon.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index cb0015f68..ead2df601 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index d478a66c5..93dabd8b7 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/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"; diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 289e2564c..542491373 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multilayersingletree/multilayersingletree.trigger.js b/src/widget/multilayersingletree/multilayersingletree.trigger.js index faf58fbf2..e75a33cbb 100644 --- a/src/widget/multilayersingletree/multilayersingletree.trigger.js +++ b/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"; diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index fc8a893f0..af2f24585 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index 4ac0d488e..1a6671c5b 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multiselect/multiselect.insert.trigger.js b/src/widget/multiselect/multiselect.insert.trigger.js index d174bb140..a2f60828d 100644 --- a/src/widget/multiselect/multiselect.insert.trigger.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multiselect/multiselect.trigger.js b/src/widget/multiselect/multiselect.trigger.js index 8e9f8f09d..12e802859 100644 --- a/src/widget/multiselect/multiselect.trigger.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multiselect/trigger/editor.multiselect.js b/src/widget/multiselect/trigger/editor.multiselect.js index 2525c2fc5..8ba3ba26a 100644 --- a/src/widget/multiselect/trigger/editor.multiselect.js +++ b/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); diff --git a/src/widget/multiselect/trigger/searcher.multiselect.insert.js b/src/widget/multiselect/trigger/searcher.multiselect.insert.js index 01b3ff47d..4c5a67a11 100644 --- a/src/widget/multiselect/trigger/searcher.multiselect.insert.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multiselect/trigger/searcher.multiselect.js b/src/widget/multiselect/trigger/searcher.multiselect.js index 85a7c061c..e9d484b42 100644 --- a/src/widget/multiselect/trigger/searcher.multiselect.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index b8c19cabb..228798aaf 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js index d858aaa7b..20098684c 100644 --- a/src/widget/multitree/multi.tree.insert.combo.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js index 667c91c7b..25da4d0c8 100644 --- a/src/widget/multitree/multi.tree.list.combo.js +++ b/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); \ No newline at end of file diff --git a/src/widget/multitree/trigger/searcher.multi.tree.js b/src/widget/multitree/trigger/searcher.multi.tree.js index 2d05ae857..ffc57300b 100644 --- a/src/widget/multitree/trigger/searcher.multi.tree.js +++ b/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"; diff --git a/src/widget/singleselect/singleselect.combo.js b/src/widget/singleselect/singleselect.combo.js index 9382ff8aa..b786eee8c 100644 --- a/src/widget/singleselect/singleselect.combo.js +++ b/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); diff --git a/src/widget/singleselect/singleselect.insert.combo.js b/src/widget/singleselect/singleselect.insert.combo.js index dd1218a66..499f6e117 100644 --- a/src/widget/singleselect/singleselect.insert.combo.js +++ b/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); \ No newline at end of file diff --git a/src/widget/singleselect/singleselect.trigger.js b/src/widget/singleselect/singleselect.trigger.js index 06cf1a054..81320ef86 100644 --- a/src/widget/singleselect/singleselect.trigger.js +++ b/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); \ No newline at end of file diff --git a/src/widget/singleselect/trigger/editor.singleselect.js b/src/widget/singleselect/trigger/editor.singleselect.js index 97f196e3c..245565137 100644 --- a/src/widget/singleselect/trigger/editor.singleselect.js +++ b/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); \ No newline at end of file diff --git a/src/widget/singleselect/trigger/searcher.singleselect.js b/src/widget/singleselect/trigger/searcher.singleselect.js index 0e53b09da..f0851985a 100644 --- a/src/widget/singleselect/trigger/searcher.singleselect.js +++ b/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"; From 36b4461d1d7eb50617086e9f7f593ba0cb0e7a8c Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 24 Jun 2019 17:01:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?KERNEL-749=20=E4=BF=AE=E6=94=B9doClick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/buttons/button.icon.js | 2 +- src/base/single/input/checkbox/checkbox.image.js | 13 +------------ src/base/single/input/radio/radio.image.js | 2 +- src/case/button/icon/icon.trigger.js | 13 +------------ src/case/button/icon/iconhalf/icon.half.image.js | 13 +------------ src/case/checkbox/check.arrownode.js | 4 +--- src/case/checkbox/check.first.treenode.js | 3 --- src/case/checkbox/check.last.treenode.js | 3 --- src/case/checkbox/check.mid.treenode.js | 3 --- src/case/checkbox/check.treenode.js | 3 --- 10 files changed, 6 insertions(+), 53 deletions(-) diff --git a/src/base/single/button/buttons/button.icon.js b/src/base/single/button/buttons/button.icon.js index ec059e8bc..62f9a5bd0 100644 --- a/src/base/single/button/buttons/button.icon.js +++ b/src/base/single/button/buttons/button.icon.js @@ -48,5 +48,5 @@ BI.IconButton = BI.inherit(BI.BasicButton, { } } }); -BI.IconButton.EVENT_CHANGE = "IconButton.EVENT_CHANGE"; +BI.IconButton.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.icon_button", BI.IconButton); \ No newline at end of file diff --git a/src/base/single/input/checkbox/checkbox.image.js b/src/base/single/input/checkbox/checkbox.image.js index c20127f60..dc1703567 100644 --- a/src/base/single/input/checkbox/checkbox.image.js +++ b/src/base/single/input/checkbox/checkbox.image.js @@ -15,19 +15,8 @@ BI.ImageCheckbox = BI.inherit(BI.IconButton, { iconWidth: 16, iconHeight: 16 }); - }, - - _init: function () { - BI.ImageCheckbox.superclass._init.apply(this, arguments); - }, - - doClick: function () { - BI.ImageCheckbox.superclass.doClick.apply(this, arguments); - if(this.isValid()) { - this.fireEvent(BI.Checkbox.EVENT_CHANGE); - } } }); -BI.ImageCheckbox.EVENT_CHANGE = "EVENT_CHANGE"; +BI.ImageCheckbox.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE; BI.shortcut("bi.image_checkbox", BI.ImageCheckbox); \ No newline at end of file diff --git a/src/base/single/input/radio/radio.image.js b/src/base/single/input/radio/radio.image.js index 7fc365aea..744bb511a 100644 --- a/src/base/single/input/radio/radio.image.js +++ b/src/base/single/input/radio/radio.image.js @@ -28,6 +28,6 @@ BI.ImageRadio = BI.inherit(BI.IconButton, { } } }); -BI.ImageRadio.EVENT_CHANGE = "EVENT_CHANGE"; +BI.ImageRadio.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE; BI.shortcut("bi.image_radio", BI.ImageRadio); \ No newline at end of file diff --git a/src/case/button/icon/icon.trigger.js b/src/case/button/icon/icon.trigger.js index f37906a75..6f7c2a1ee 100644 --- a/src/case/button/icon/icon.trigger.js +++ b/src/case/button/icon/icon.trigger.js @@ -13,18 +13,7 @@ BI.TriggerIconButton = BI.inherit(BI.IconButton, { baseCls: (conf.baseCls || "") + " bi-trigger-icon-button", extraCls: "pull-down-font" }); - }, - - _init: function () { - BI.TriggerIconButton.superclass._init.apply(this, arguments); - }, - - doClick: function () { - BI.TriggerIconButton.superclass.doClick.apply(this, arguments); - if (this.isValid()) { - this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE, this); - } } }); -BI.TriggerIconButton.EVENT_CHANGE = "EVENT_CHANGE"; +BI.TriggerIconButton.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE; BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton); \ No newline at end of file diff --git a/src/case/button/icon/iconhalf/icon.half.image.js b/src/case/button/icon/iconhalf/icon.half.image.js index 925f1211d..a9e9d0014 100644 --- a/src/case/button/icon/iconhalf/icon.half.image.js +++ b/src/case/button/icon/iconhalf/icon.half.image.js @@ -14,19 +14,8 @@ BI.HalfIconButton = BI.inherit(BI.IconButton, { iconHeight: 16, selected: false }); - }, - - _init: function () { - BI.HalfIconButton.superclass._init.apply(this, arguments); - }, - - doClick: function () { - BI.HalfIconButton.superclass.doClick.apply(this, arguments); - if(this.isValid()) { - this.fireEvent(BI.HalfIconButton.EVENT_CHANGE); - } } }); -BI.HalfIconButton.EVENT_CHANGE = "EVENT_CHANGE"; +BI.HalfIconButton.EVENT_CHANGE = BI.IconButton.EVENT_CHANGE; BI.shortcut("bi.half_icon_button", BI.HalfIconButton); \ No newline at end of file diff --git a/src/case/checkbox/check.arrownode.js b/src/case/checkbox/check.arrownode.js index 84b6fd578..ebcb784d7 100644 --- a/src/case/checkbox/check.arrownode.js +++ b/src/case/checkbox/check.arrownode.js @@ -8,9 +8,7 @@ BI.ArrowTreeGroupNodeCheckbox = BI.inherit(BI.IconButton, { extraCls: "bi-arrow-group-node-checkbox" }); }, - _init: function () { - BI.ArrowTreeGroupNodeCheckbox.superclass._init.apply(this, arguments); - }, + setSelected: function (v) { BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this, arguments); if(v) { diff --git a/src/case/checkbox/check.first.treenode.js b/src/case/checkbox/check.first.treenode.js index 19b3e75e4..572908d8d 100644 --- a/src/case/checkbox/check.first.treenode.js +++ b/src/case/checkbox/check.first.treenode.js @@ -11,10 +11,7 @@ BI.FirstTreeNodeCheckbox = BI.inherit(BI.IconButton, { iconHeight: 24 }); }, - _init: function () { - BI.FirstTreeNodeCheckbox.superclass._init.apply(this, arguments); - }, setSelected: function (v) { BI.FirstTreeNodeCheckbox.superclass.setSelected.apply(this, arguments); if(v === true) { diff --git a/src/case/checkbox/check.last.treenode.js b/src/case/checkbox/check.last.treenode.js index 58bb22f3d..e0a9f621d 100644 --- a/src/case/checkbox/check.last.treenode.js +++ b/src/case/checkbox/check.last.treenode.js @@ -11,10 +11,7 @@ BI.LastTreeNodeCheckbox = BI.inherit(BI.IconButton, { iconHeight: 24 }); }, - _init: function () { - BI.LastTreeNodeCheckbox.superclass._init.apply(this, arguments); - }, setSelected: function (v) { BI.LastTreeNodeCheckbox.superclass.setSelected.apply(this, arguments); if (v === true) { diff --git a/src/case/checkbox/check.mid.treenode.js b/src/case/checkbox/check.mid.treenode.js index 79a1a3e97..7679b466e 100644 --- a/src/case/checkbox/check.mid.treenode.js +++ b/src/case/checkbox/check.mid.treenode.js @@ -11,10 +11,7 @@ BI.MidTreeNodeCheckbox = BI.inherit(BI.IconButton, { iconHeight: 24 }); }, - _init: function () { - BI.MidTreeNodeCheckbox.superclass._init.apply(this, arguments); - }, setSelected: function (v) { BI.MidTreeNodeCheckbox.superclass.setSelected.apply(this, arguments); if(v === true) { diff --git a/src/case/checkbox/check.treenode.js b/src/case/checkbox/check.treenode.js index 4f9088c4b..b5642aae4 100644 --- a/src/case/checkbox/check.treenode.js +++ b/src/case/checkbox/check.treenode.js @@ -11,10 +11,7 @@ BI.TreeNodeCheckbox = BI.inherit(BI.IconButton, { iconHeight: 24 }); }, - _init: function () { - BI.TreeNodeCheckbox.superclass._init.apply(this, arguments); - }, setSelected: function (v) { BI.TreeNodeCheckbox.superclass.setSelected.apply(this, arguments); if(v) { From 69d88ae6bd904a67367d426452c0d9c5de3c84ae Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 24 Jun 2019 19:31:34 +0800 Subject: [PATCH 3/3] update --- src/widget/multilayerselecttree/multilayerselecttree.combo.js | 1 + src/widget/multilayersingletree/multilayersingletree.combo.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index ead2df601..d525575f2 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -116,6 +116,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }, items: o.items, itemsCreator: o.itemsCreator, + valueFormatter: o.valueFormatter, height: o.height - 2, text: o.text, value: o.value, diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index 542491373..bd13e4de6 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -119,6 +119,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { }, items: o.items, itemsCreator: o.itemsCreator, + valueFormatter: o.valueFormatter, height: o.height - 2, text: o.text, value: o.value,