diff --git a/src/widget/multilayersingletree/node/node.first.plus.js b/src/widget/multilayersingletree/node/node.first.plus.js index a5d053a59..f72f49ed2 100644 --- a/src/widget/multilayersingletree/node/node.first.plus.js +++ b/src/widget/multilayersingletree/node/node.first.plus.js @@ -20,29 +20,7 @@ BI.MultiLayerSingleTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { _init: function () { BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.node = BI.createWidget({ - type: "bi.first_plus_group_node", - cls: "bi-list-item-none", - logic: { - dynamic: true - }, - id: o.id, - pId: o.pId, - open: o.open, - isLastNode: o.isLastNode, - height: o.height, - hgap: o.hgap, - text: o.text, - value: o.value, - py: o.py, - keyword: o.keyword - }); - this.node.on(BI.Controller.EVENT_CHANGE, function (type) { - if (type === BI.Events.CLICK) {// 本身实现click功能 - return; - } - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); + this.node = this._createNode(); var needBlankLayers = []; var pNode = o.pNode; @@ -89,6 +67,37 @@ BI.MultiLayerSingleTreeFirstPlusGroupNode = BI.inherit(BI.NodeButton, { if (BI.isNotNull(this.node)) { this.node.setOpened(v); } + }, + + _createNode: function () { + var self = this, o = this.options; + + return BI.createWidget({ + type: "bi.first_plus_group_node", + cls: "bi-list-item-none", + logic: { + dynamic: true + }, + id: o.id, + pId: o.pId, + open: o.open, + isLastNode: o.isLastNode, + height: o.height, + hgap: o.hgap, + text: o.text, + value: o.value, + py: o.py, + keyword: o.keyword, + listeners: [{ + eventName: BI.Controller.EVENT_CHANGE, + action: function (type) { + if (type === BI.Events.CLICK) {// 本身实现click功能 + return; + } + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + } + }] + }); } }); diff --git a/src/widget/multilayersingletree/node/node.last.plus.js b/src/widget/multilayersingletree/node/node.last.plus.js index ffdb62dda..02a8a26e0 100644 --- a/src/widget/multilayersingletree/node/node.last.plus.js +++ b/src/widget/multilayersingletree/node/node.last.plus.js @@ -20,28 +20,7 @@ BI.MultiLayerSingleTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { _init: function () { BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.node = BI.createWidget({ - type: "bi.last_plus_group_node", - cls: "bi-list-item-none", - logic: { - dynamic: true - }, - id: o.id, - pId: o.pId, - open: o.open, - height: o.height, - hgap: o.hgap, - text: o.text, - value: o.value, - py: o.py, - keyword: o.keyword - }); - this.node.on(BI.Controller.EVENT_CHANGE, function (type) { - if (type === BI.Events.CLICK) {// 本身实现click功能 - return; - } - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); + this.node = this._createNode(); var needBlankLayers = []; var pNode = o.pNode; @@ -88,6 +67,36 @@ BI.MultiLayerSingleTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, { if (BI.isNotNull(this.node)) { this.node.setOpened(v); } + }, + + _createNode: function () { + var self = this, o = this.options; + + return BI.createWidget({ + type: "bi.last_plus_group_node", + cls: "bi-list-item-none", + logic: { + dynamic: true + }, + id: o.id, + pId: o.pId, + open: o.open, + height: o.height, + hgap: o.hgap, + text: o.text, + value: o.value, + py: o.py, + keyword: o.keyword, + listeners: [{ + eventName: BI.Controller.EVENT_CHANGE, + action: function (type) { + if (type === BI.Events.CLICK) {// 本身实现click功能 + return; + } + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + } + }] + }); } }); diff --git a/src/widget/multilayersingletree/node/node.mid.plus.js b/src/widget/multilayersingletree/node/node.mid.plus.js index 482917bef..64612ca04 100644 --- a/src/widget/multilayersingletree/node/node.mid.plus.js +++ b/src/widget/multilayersingletree/node/node.mid.plus.js @@ -20,28 +20,7 @@ BI.MultiLayerSingleTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { _init: function () { BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.node = BI.createWidget({ - type: "bi.mid_plus_group_node", - cls: "bi-list-item-none", - logic: { - dynamic: true - }, - id: o.id, - pId: o.pId, - open: o.open, - height: o.height, - hgap: o.hgap, - text: o.text, - value: o.value, - py: o.py, - keyword: o.keyword - }); - this.node.on(BI.Controller.EVENT_CHANGE, function (type) { - if (type === BI.Events.CLICK) {// 本身实现click功能 - return; - } - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); + this.node = this._createNode(); var needBlankLayers = []; var pNode = o.pNode; @@ -88,6 +67,36 @@ BI.MultiLayerSingleTreeMidPlusGroupNode = BI.inherit(BI.NodeButton, { if (BI.isNotNull(this.node)) { this.node.setOpened(v); } + }, + + _createNode: function () { + var self = this, o = this.options; + + return BI.createWidget({ + type: "bi.mid_plus_group_node", + cls: "bi-list-item-none", + logic: { + dynamic: true + }, + id: o.id, + pId: o.pId, + open: o.open, + height: o.height, + hgap: o.hgap, + text: o.text, + value: o.value, + py: o.py, + keyword: o.keyword, + listeners: [{ + eventName: BI.Controller.EVENT_CHANGE, + action: function (type) { + if (type === BI.Events.CLICK) {// 本身实现click功能 + return; + } + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + } + }] + }); } }); diff --git a/src/widget/multilayersingletree/node/node.plus.js b/src/widget/multilayersingletree/node/node.plus.js index 93d60c58c..b2fbd37e6 100644 --- a/src/widget/multilayersingletree/node/node.plus.js +++ b/src/widget/multilayersingletree/node/node.plus.js @@ -18,32 +18,7 @@ BI.MultiLayerSingleTreePlusGroupNode = BI.inherit(BI.NodeButton, { _init: function () { BI.MultiLayerSingleTreePlusGroupNode.superclass._init.apply(this, arguments); var self = this, o = this.options; - if (o.isLastNode && !o.pNode) { - - } - this.node = BI.createWidget({ - type: "bi.plus_group_node", - cls: "bi-list-item-none", - logic: { - dynamic: true - }, - id: o.id, - pId: o.pId, - open: o.open, - isLastNode: o.isLastNode, - height: o.height, - hgap: o.hgap, - text: o.text, - value: o.value, - py: o.py, - keyword: o.keyword - }); - this.node.on(BI.Controller.EVENT_CHANGE, function (type) { - if (type === BI.Events.CLICK) {// 本身实现click功能 - return; - } - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); + this.node = this._createNode(); var needBlankLayers = []; var pNode = o.pNode; @@ -90,6 +65,37 @@ BI.MultiLayerSingleTreePlusGroupNode = BI.inherit(BI.NodeButton, { if (BI.isNotNull(this.node)) { this.node.setOpened(v); } + }, + + _createNode: function () { + var self = this, o = this.options; + + return BI.createWidget({ + type: "bi.plus_group_node", + cls: "bi-list-item-none", + logic: { + dynamic: true + }, + id: o.id, + pId: o.pId, + open: o.open, + isLastNode: o.isLastNode, + height: o.height, + hgap: o.hgap, + text: o.text, + value: o.value, + py: o.py, + keyword: o.keyword, + listeners: [{ + eventName: BI.Controller.EVENT_CHANGE, + action: function (type) { + if (type === BI.Events.CLICK) {// 本身实现click功能 + return; + } + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + } + }] + }); } });