您可以更新选择器组件代码:
触摸/src/picker/Date.js:
/**
* Update by ZWD/gloot
* Date: 7/30/2013
*/
onDoneButtonTap: function() {
var me = this;
var oldValue = this._value,
newValue = this.getValue(true),
testValue = newValue;
if (Ext.isDate(newValue)) {
testValue = newValue.toDateString();
}
if (Ext.isDate(oldValue)) {
oldValue = oldValue.toDateString();
}
if (testValue != oldValue) {
this.fireEvent('change', this, newValue);
}
setTimeout(function() {
me.hide();
me.inputBlocker.unblockInputs();
}, 300);
Ext.hideKeyboard();
}
和picker/Picker.js
/**
* @private
* Called when the done button has been tapped.
* Update by ZWD/gloot
* Date: 7/30/2013
*/
onDoneButtonTap: function() {
var me = this, oldValue = me._value,
newValue = me.getValue(true);
if (newValue != oldValue) {
me.fireEvent('change', me, newValue);
}
setTimeout(function() {
me.hide();
me.inputBlocker.unblockInputs();
}, 300);
},
/**
* @private
* Called when the cancel button has been tapped.
* Update by ZWD/gloot
* Date: 7/30/2013
*/
onCancelButtonTap: function() {
var me = this;
me.fireEvent('cancel', me);
setTimeout(function() {
me.hide();
me.inputBlocker.unblockInputs();
}, 300);
}
///////////////////////////////////////// ////
the setTimeout method can solve the question!