PDA

View Full Version : Ext.ux.Spinner does not blur on trigger click



john.dunlap
21 Jan 2011, 8:24 AM
While using the spinner I noticed that when I set allowBlank to false, operating the spinner buttons with the mouse did not cause the validation outline to disappear. I altered the onTriggerClick method to execute the triggerBlur method which resolves the issue. Perhaps it isn't the best solution but it worked for me.



//private
onTriggerClick: function(){
if (this.disabled || this.el.dom.readOnly) {
return;
}
var middle = this.getMiddle();
var ud = (Ext.EventObject.getPageY() < middle) ? 'Up' : 'Down';
this['onSpin' + ud]();
this.triggerBlur();
},

john.dunlap
24 Jan 2011, 7:30 AM
Repackaged as an override,

/**
* While using the spinner I noticed that when I set allowBlank to false, operating the spinner buttons with the mouse
* did not cause the validation outline to disappear. I altered the onTriggerClick method to execute the triggerBlur
* method which resolves the issue. Perhaps it isn't the best solution but it worked for me.
*/
Ext.override(Ext.ux.Spinner, {
onTriggerClick: function(){
if (this.disabled || this.el.dom.readOnly) {
return;
}
var middle = this.getMiddle();
var ud = (Ext.EventObject.getPageY() < middle) ? 'Up' : 'Down';
this['onSpin' + ud]();
this.triggerBlur();
}
});