您可以更新選擇器組件代碼:
觸摸/ src目錄/選擇器/ 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.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!