-
5 Oct 2010 9:49 AM #1
Strange behavior when using vtype with combo box.
Strange behavior when using vtype with combo box.
I am trying to validate the user's selection in a combobox using a vtype. The value passed to the test function of my vtype is the display value not the underlying value I actually want to validate. I can't even get the underlying value by calling getValue() on the combobox form field itself from within the test function. Is this the intended behavior? Is there any way to get the value of the combobox from within the vtype test function?
-
6 Oct 2010 2:09 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
Yes, this is by design. Comboboxes that require validation are usually the editable:true type comboboxes without a valueField, so the raw text is sent to the validation process.
If you want to modify this then you should write a processValue method, e.g.
Code:processValue: function(v) { var r = this.findRecord(this.displayField, v); return r ? r.get(this.valueField) : ''; }
-
6 Oct 2010 9:24 AM #3
Thanks Condor.
I'll definitely include that little code snippet in my bag of tricks. But I have to tell you I'm still shaking my head over this one.
Similar Threads
-
Combo box store loading but not displaying data - strange behavior
By john.dowson in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 26 Mar 2010, 10:22 AM -
Combo Store filter strange behavior
By crxtech in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 15 Jul 2008, 9:23 AM -
Grid behavior for Combo box
By poonam in forum Ext 2.x: Help & DiscussionReplies: 6Last Post: 26 Jun 2008, 9:52 AM -
Issue with Combo Box behavior within a form that is within a tab
By johnbarbic in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 30 Apr 2008, 11:14 PM -
1.0[b1] JSONReader Combo Box Strange Behavior
By jon.whitcraft in forum Ext 1.x: BugsReplies: 6Last Post: 9 Apr 2007, 11:19 PM


Reply With Quote