forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.5 KiB
83 lines
2.5 KiB
8 years ago
|
/**
|
||
|
* 加号表示的组节点
|
||
|
*
|
||
|
* Created by GUY on 2016/1/27.
|
||
|
* @class BI.MultiLayerSingleTreeLastPlusGroupNode
|
||
|
* @extends BI.NodeButton
|
||
|
*/
|
||
|
BI.MultiLayerSingleTreeLastPlusGroupNode = BI.inherit(BI.NodeButton, {
|
||
|
_defaultConfig: function () {
|
||
|
var conf = BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._defaultConfig.apply(this, arguments);
|
||
|
return BI.extend(conf, {
|
||
|
extraCls: "bi-multilayer-single-tree-last-plus-group-node bi-list-item",
|
||
|
layer: 0,//第几层级
|
||
|
id: "",
|
||
|
pId: "",
|
||
|
open: false,
|
||
|
height: 25
|
||
|
})
|
||
|
},
|
||
|
_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",
|
||
|
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
|
||
|
});
|
||
|
this.node.on(BI.Controller.EVENT_CHANGE, function (type) {
|
||
|
if (type === BI.Events.CLICK) {//本身实现click功能
|
||
|
return;
|
||
|
}
|
||
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
|
||
|
});
|
||
|
|
||
|
var items = [];
|
||
|
BI.count(0, o.layer, function () {
|
||
|
items.push({
|
||
|
type: "bi.layout",
|
||
|
cls: "base-line-conn-background",
|
||
|
width: 13,
|
||
|
height: o.height
|
||
|
})
|
||
|
});
|
||
|
items.push(this.node);
|
||
|
BI.createWidget({
|
||
|
type: "bi.td",
|
||
|
element: this,
|
||
|
columnSize: BI.makeArray(o.layer, 13),
|
||
|
items: [items]
|
||
|
})
|
||
|
},
|
||
|
|
||
|
doRedMark: function () {
|
||
|
this.node.doRedMark.apply(this.node, arguments);
|
||
|
},
|
||
|
|
||
|
unRedMark: function () {
|
||
|
this.node.unRedMark.apply(this.node, arguments);
|
||
|
},
|
||
|
|
||
|
doClick: function () {
|
||
|
BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.doClick.apply(this, arguments);
|
||
|
this.node.setSelected(this.isSelected());
|
||
|
},
|
||
|
|
||
|
setOpened: function (v) {
|
||
|
BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.setOpened.apply(this, arguments);
|
||
|
if (BI.isNotNull(this.node)) {
|
||
|
this.node.setOpened(v);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$.shortcut("bi.multilayer_single_tree_last_plus_group_node", BI.MultiLayerSingleTreeLastPlusGroupNode);
|