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.
56 lines
1.6 KiB
56 lines
1.6 KiB
!(function () { |
|
var Widget = BI.inherit(BI.Widget, { |
|
props: function () { |
|
return { |
|
baseCls: "bi-tree-expander-popup", |
|
layer: 0, // 第几层级 |
|
el: {}, |
|
isLastNode: false, |
|
}; |
|
}, |
|
|
|
render: function () { |
|
|
|
var self = this; |
|
var o = this.options; |
|
var offset = BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2; |
|
|
|
this.popupView = BI.createWidget(BI.extend(o.el, { |
|
value: o.value |
|
}), this); |
|
|
|
this.popupView.on(BI.Controller.EVENT_CHANGE, function () { |
|
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); |
|
}); |
|
this.popupView.element.css("margin-left", -offset * (o.layer + 1)); |
|
this.element.css("margin-left", offset * (o.layer + 1)); |
|
|
|
return { |
|
type: "bi.vertical", |
|
cls: !o.isLastNode ? (BI.STYLE_CONSTANTS.LINK_LINE_TYPE === "solid" ? "line solid" : "line") : "", |
|
scrolly: null, |
|
items: [ |
|
this.popupView, |
|
], |
|
}; |
|
}, |
|
|
|
setValue: function (v) { |
|
this.popupView.setValue(v); |
|
}, |
|
|
|
getValue: function () { |
|
return this.popupview.getValue(); |
|
}, |
|
|
|
populate: function (items) { |
|
this.popupview.populate(items); |
|
}, |
|
|
|
getAllLeaves: function () { |
|
return this.popupView && this.popupView.getAllLeaves(); |
|
} |
|
}); |
|
|
|
BI.shortcut("bi.tree_expander.popup", Widget); |
|
}());
|
|
|