|
|
@ -11,11 +11,7 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { |
|
|
|
var o = this.options, self = this; |
|
|
|
var o = this.options, self = this; |
|
|
|
this.popup = BI.createWidget({ |
|
|
|
this.popup = BI.createWidget({ |
|
|
|
type: "bi.button_group", |
|
|
|
type: "bi.button_group", |
|
|
|
items: BI.createItems(o.items, { |
|
|
|
items: this._formatItems(o.items), |
|
|
|
type: "bi.single_select_item", |
|
|
|
|
|
|
|
textAlign: o.textAlign, |
|
|
|
|
|
|
|
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
chooseType: o.chooseType, |
|
|
|
chooseType: o.chooseType, |
|
|
|
layouts: [{ |
|
|
|
layouts: [{ |
|
|
|
type: "bi.vertical" |
|
|
|
type: "bi.vertical" |
|
|
@ -39,13 +35,21 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_formatItems: function (items) { |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
return BI.map(items, function (i, item) { |
|
|
|
|
|
|
|
return BI.extend({ |
|
|
|
|
|
|
|
type: "bi.single_select_item", |
|
|
|
|
|
|
|
textAlign: o.textAlign, |
|
|
|
|
|
|
|
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
|
|
|
|
|
|
|
title: item.title || item.text |
|
|
|
|
|
|
|
}, item); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
populate: function (items) { |
|
|
|
BI.TextValueComboPopup.superclass.populate.apply(this, arguments); |
|
|
|
BI.TextValueComboPopup.superclass.populate.apply(this, arguments); |
|
|
|
items = BI.createItems(items, { |
|
|
|
this.popup.populate(this._formatItems(items)); |
|
|
|
type: "bi.single_select_item", |
|
|
|
|
|
|
|
height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.popup.populate(items); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
getValue: function () { |
|
|
@ -58,4 +62,4 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.TextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.TextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.shortcut("bi.text_value_combo_popup", BI.TextValueComboPopup); |
|
|
|
BI.shortcut("bi.text_value_combo_popup", BI.TextValueComboPopup); |
|
|
|