-
13 May 2007 3:41 AM #1
ComboBox causing "blur" event when clicking on it's expand button
ComboBox causing "blur" event when clicking on it's expand button
Hi All,
Firstly, I have to say that ext library has blown me away for the incredibly polished things it achieves!
One small thing I noticed when I was playing with forms in [v1.0.1a]...
For my application, I find that validation firing before a user has finished completing a field is a little premature, so I set a global behaviour to cause validation on field blur with the following code:
This works exactly as expected except with ComboBoxes. When you click the little button to expand the box, it causes a blur event (and therefore validation) because the focus has gone off the actual entry box. This causes validation warnings when the user hasn't yet had a chance to choose a value.Code:Ext.form.Field.prototype.validationEvent = 'blur';
Not sure if there's an undocumented event I should use instead of "blur" for ComboBoxes to get around this, or whether the textbox and expand button should be considered as a single entity for firing off events, but would welcome the guru's thoughts on this.
Keep up the great coding guys!
Cheers,
Ben
-
13 May 2007 3:49 AM #2
The validation event is the configurable option. See http://extjs.com/deploy/ext/docs/output/Ext.form.Field.html#configs.
You should post into Bugs forum only if you are 100% sure it's the bug and, ideally, together with a proposed solution.
Otherwise to Help forum if you have a specific question or you need a help on a specific matter or to General Discussion forum if you have questions about basic design philosophy.Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
13 May 2007 3:57 AM #3
Alternative to "blur" to validate when user leaving field?
Alternative to "blur" to validate when user leaving field?
I understand that I can configure the valiationEvent - just cant find burried in the docs a better alternative to "blur", or I'd override validationEvent on the indiviual fields that are misbehaving (ie: ComboBoxes).
Tripping "blur" validation when someone clicks on something within the control seems inconsistent behaviour -as technically the focus has only been lost from an individual DOM object - not the ComboBox itself.
And sorry - I'm still stretching my brain to appreciate the work these guys have put in - if I had already devised the solution I would happily share it.
-
13 May 2007 4:03 AM #4
OK, let's have an Ext team member to aswer if this behavior is by design, if it's bug, or else. I'm interested too as I'm going to implement both client and server side validations soon.
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
13 May 2007 4:40 PM #5
Let me see if I have this right - you override the default validation and set it to blur, then post in bugs when the field is validating when it is blurred? Clicking on the trigger is blurring the form field, Ext cannot control that.


Reply With Quote