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.
96 lines
2.7 KiB
96 lines
2.7 KiB
8 years ago
|
/**
|
||
|
*
|
||
|
* Created by GUY on 2016/1/27.
|
||
|
* @class BI.MultiLayerSingleTreeFirstTreeLeafItem
|
||
|
* @extends BI.BasicButton
|
||
|
*/
|
||
|
BI.MultiLayerSingleTreeFirstTreeLeafItem = BI.inherit(BI.BasicButton, {
|
||
|
_defaultConfig: function () {
|
||
|
return BI.extend(BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._defaultConfig.apply(this, arguments), {
|
||
|
extraCls: "bi-multilayer-single-tree-first-tree-leaf-item bi-list-item-active",
|
||
|
logic: {
|
||
|
dynamic: false
|
||
|
},
|
||
|
layer: 0,
|
||
|
id: "",
|
||
|
pId: "",
|
||
|
height: 25
|
||
|
})
|
||
|
},
|
||
|
_init: function () {
|
||
|
BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._init.apply(this, arguments);
|
||
|
var self = this, o = this.options;
|
||
|
this.item = BI.createWidget({
|
||
|
type: "bi.first_tree_leaf_item",
|
||
|
logic: {
|
||
|
dynamic: true
|
||
|
},
|
||
|
id: o.id,
|
||
|
pId: o.pId,
|
||
|
height: o.height,
|
||
|
hgap: o.hgap,
|
||
|
text: o.text,
|
||
|
value: o.value,
|
||
|
py: o.py
|
||
|
});
|
||
|
this.item.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.item);
|
||
|
BI.createWidget({
|
||
|
type: "bi.td",
|
||
|
element: this,
|
||
|
columnSize: BI.makeArray(o.layer, 13),
|
||
|
items: [items]
|
||
|
})
|
||
|
},
|
||
|
|
||
|
doRedMark: function () {
|
||
|
this.item.doRedMark.apply(this.item, arguments);
|
||
|
},
|
||
|
|
||
|
unRedMark: function () {
|
||
|
this.item.unRedMark.apply(this.item, arguments);
|
||
|
},
|
||
|
|
||
|
doHighLight: function () {
|
||
|
this.item.doHighLight.apply(this.item, arguments);
|
||
|
},
|
||
|
|
||
|
unHighLight: function () {
|
||
|
this.item.unHighLight.apply(this.item, arguments);
|
||
|
},
|
||
|
|
||
|
getId: function () {
|
||
|
return this.options.id;
|
||
|
},
|
||
|
|
||
|
getPId: function () {
|
||
|
return this.options.pId;
|
||
|
},
|
||
|
|
||
|
doClick: function () {
|
||
|
BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.doClick.apply(this, arguments);
|
||
|
this.item.setSelected(this.isSelected());
|
||
|
},
|
||
|
|
||
|
setSelected: function (v) {
|
||
|
BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.setSelected.apply(this, arguments);
|
||
|
this.item.setSelected(v);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$.shortcut("bi.multilayer_single_tree_first_tree_leaf_item", BI.MultiLayerSingleTreeFirstTreeLeafItem);
|