From 6e3f5865fbe170eb3116148df825f3b9ecba9b11 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 21 Jul 2022 14:50:10 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-12098=20feat:=20radio=E5=92=8Ccheckbox?= =?UTF-8?q?=20item=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fineui中的代码是可以作为其他同学开发自定义组件的参考的. 所以一定要保持规范优雅 --- src/case/button/item.multiselect.js | 6 ------ src/case/button/item.singleselect.radio.js | 11 ----------- 2 files changed, 17 deletions(-) diff --git a/src/case/button/item.multiselect.js b/src/case/button/item.multiselect.js index 0d44b6da8..b90fafac5 100644 --- a/src/case/button/item.multiselect.js +++ b/src/case/button/item.multiselect.js @@ -20,11 +20,6 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { this.checkbox = BI.createWidget({ type: "bi.checkbox" }); - this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) { - if (type === BI.Events.CLICK) { - self.setSelected(self.isSelected()); - } - }); return { type: "bi.vertical_adapt", columnSize: [o.iconWrapperWidth || o.height, "fill"], @@ -74,7 +69,6 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { doClick: function () { BI.MultiSelectItem.superclass.doClick.apply(this, arguments); - this.checkbox.setSelected(this.isSelected()); if (this.isValid()) { this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE, this.getValue(), this); } diff --git a/src/case/button/item.singleselect.radio.js b/src/case/button/item.singleselect.radio.js index a7c5fe04b..74ebe49c9 100644 --- a/src/case/button/item.singleselect.radio.js +++ b/src/case/button/item.singleselect.radio.js @@ -28,16 +28,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { ref: function (_ref) { self.radio = _ref; }, - listeners: [ - { - eventName: BI.Controller.EVENT_CHANGE, - action: function (type) { - if (type === BI.Events.CLICK) { - self.setSelected(self.isSelected()); - } - } - } - ], }] }, { el: { @@ -82,7 +72,6 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { doClick: function () { BI.SingleSelectRadioItem.superclass.doClick.apply(this, arguments); - this.radio.setSelected(this.isSelected()); if (this.isValid()) { this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE, this.isSelected(), this); }