|
|
|
@ -22,29 +22,13 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
|
|
|
|
|
_init: function () { |
|
|
|
|
BI.DownListCombo.superclass._init.apply(this, arguments); |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
this.popupview = BI.createWidget({ |
|
|
|
|
type: "bi.down_list_popup", |
|
|
|
|
items: o.items, |
|
|
|
|
chooseType: o.chooseType, |
|
|
|
|
value: o.value |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.popupview.on(BI.DownListPopup.EVENT_CHANGE, function (value) { |
|
|
|
|
self.fireEvent(BI.DownListCombo.EVENT_CHANGE, value); |
|
|
|
|
self.downlistcombo.hideView(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE, function (value, fatherValue) { |
|
|
|
|
self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, value, fatherValue); |
|
|
|
|
self.downlistcombo.hideView(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.downlistcombo = BI.createWidget({ |
|
|
|
|
element: this, |
|
|
|
|
type: "bi.combo", |
|
|
|
|
trigger: o.trigger, |
|
|
|
|
isNeedAdjustWidth: false, |
|
|
|
|
isDefaultInit: true, |
|
|
|
|
container: o.container, |
|
|
|
|
adjustLength: o.adjustLength, |
|
|
|
|
direction: o.direction, |
|
|
|
@ -58,7 +42,28 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
|
|
|
|
|
height: o.height |
|
|
|
|
}), |
|
|
|
|
popup: { |
|
|
|
|
el: this.popupview, |
|
|
|
|
el: { |
|
|
|
|
type: "bi.down_list_popup", |
|
|
|
|
ref: function (ref) { |
|
|
|
|
self.popupView = ref; |
|
|
|
|
}, |
|
|
|
|
items: o.items, |
|
|
|
|
chooseType: o.chooseType, |
|
|
|
|
value: o.value, |
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: BI.DownListPopup.EVENT_CHANGE, |
|
|
|
|
action: function (value) { |
|
|
|
|
self.fireEvent(BI.DownListCombo.EVENT_CHANGE, value); |
|
|
|
|
self.downlistcombo.hideView(); |
|
|
|
|
} |
|
|
|
|
}, { |
|
|
|
|
eventName: BI.DownListPopup.EVENT_SON_VALUE_CHANGE, |
|
|
|
|
action: function (value, fatherValue) { |
|
|
|
|
self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, value, fatherValue); |
|
|
|
|
self.downlistcombo.hideView(); |
|
|
|
|
} |
|
|
|
|
}] |
|
|
|
|
}, |
|
|
|
|
stopPropagation: o.stopPropagation, |
|
|
|
|
maxHeight: o.maxHeight, |
|
|
|
|
minWidth: o.minWidth |
|
|
|
@ -79,15 +84,15 @@ BI.DownListCombo = BI.inherit(BI.Widget, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
|
this.popupview.populate(items); |
|
|
|
|
this.popupView.populate(items); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
|
this.popupview.setValue(v); |
|
|
|
|
this.popupView.setValue(v); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
|
return this.popupview.getValue(); |
|
|
|
|
return this.popupView.getValue(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
adjustWidth: function () { |
|
|
|
|