|
|
|
@ -64,6 +64,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
self.fireEvent(BI.SingleSelectCombo.EVENT_STOP); |
|
|
|
|
}); |
|
|
|
|
this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING, function () { |
|
|
|
|
self._dataChange = true; |
|
|
|
|
self.fireEvent(BI.SingleSelectCombo.EVENT_SEARCHING); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -71,6 +72,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
self.storeValue = this.getValue(); |
|
|
|
|
assertShowValue(); |
|
|
|
|
self._defaultState(); |
|
|
|
|
self._dataChange = true; |
|
|
|
|
}); |
|
|
|
|
this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK, function () { |
|
|
|
|
if (!self.combo.isViewVisible()) { |
|
|
|
@ -95,6 +97,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
listeners: [{ |
|
|
|
|
eventName: BI.SingleSelectPopupView.EVENT_CHANGE, |
|
|
|
|
action: function () { |
|
|
|
|
self._dataChange = true; |
|
|
|
|
self.storeValue = this.getValue(); |
|
|
|
|
self._adjust(function () { |
|
|
|
|
assertShowValue(); |
|
|
|
@ -120,6 +123,9 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW, function () { |
|
|
|
|
if (!this.isViewVisible()) { |
|
|
|
|
self._dataChange = false;// 标记数据是否发生变化
|
|
|
|
|
} |
|
|
|
|
this.setValue(self.storeValue); |
|
|
|
|
BI.nextTick(function () { |
|
|
|
|
self.populate(); |
|
|
|
@ -133,7 +139,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
if (self.requesting === true) { |
|
|
|
|
self.wants2Quit = true; |
|
|
|
|
} else { |
|
|
|
|
self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM); |
|
|
|
|
self._dataChange && self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -173,7 +179,8 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
this.combo.hideView(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_assertValue: function (val) {}, |
|
|
|
|
_assertValue: function (val) { |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_makeMap: function (values) { |
|
|
|
|
return BI.makeObject(values || []); |
|
|
|
@ -220,7 +227,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, {
|
|
|
|
|
|
|
|
|
|
function adjust () { |
|
|
|
|
if (self.wants2Quit === true) { |
|
|
|
|
self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM); |
|
|
|
|
self._dataChange && self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM); |
|
|
|
|
self.wants2Quit = false; |
|
|
|
|
} |
|
|
|
|
self.requesting = false; |
|
|
|
|