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