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.
50 lines
1.3 KiB
50 lines
1.3 KiB
7 years ago
|
BI.LinearSegment = BI.inherit(BI.Widget, {
|
||
|
|
||
|
props: {
|
||
|
baseCls: "bi-linear-segment bi-border-bottom",
|
||
|
items: [],
|
||
|
height: 29
|
||
|
},
|
||
|
|
||
|
render: function () {
|
||
|
var self = this, o = this.options;
|
||
|
return {
|
||
|
type: "bi.button_group",
|
||
|
items: BI.createItems(o.items, {
|
||
|
type: "bi.linear_segment_button",
|
||
|
height: o.height - 1
|
||
|
}),
|
||
|
layout: [{
|
||
|
type: "bi.center"
|
||
|
}],
|
||
|
listeners: [{
|
||
|
eventName: "__EVENT_CHANGE__",
|
||
|
action: function () {
|
||
|
self.fireEvent("__EVENT_CHANGE__", arguments);
|
||
|
}
|
||
|
}, {
|
||
|
eventName: "EVENT_CHANGE",
|
||
|
action: function () {
|
||
|
self.fireEvent("EVENT_CHANGE");
|
||
|
}
|
||
|
}],
|
||
|
ref: function () {
|
||
|
self.buttonGroup = this;
|
||
|
}
|
||
|
};
|
||
|
},
|
||
|
|
||
|
setValue: function (v) {
|
||
|
this.buttonGroup.setValue(v);
|
||
|
},
|
||
|
|
||
|
setEnabledValue: function (v) {
|
||
|
this.buttonGroup.setEnabledValue(v);
|
||
|
},
|
||
|
|
||
|
|
||
|
getValue: function () {
|
||
|
return this.buttonGroup.getValue();
|
||
|
}
|
||
|
});
|
||
|
BI.shortcut("bi.linear_segment", BI.LinearSegment);
|