1. #1
    Sencha User
    Join Date
    Dec 2007
    Posts
    79
    Vote Rating
    2
    sl5337 is on a distinguished road

      0  

    Default 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?

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    98
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    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) : '';
    }

  3. #3
    Sencha User
    Join Date
    Dec 2007
    Posts
    79
    Vote Rating
    2
    sl5337 is on a distinguished road

      0  

    Default


    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

  1. Combo box store loading but not displaying data - strange behavior
    By john.dowson in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 26 Mar 2010, 10:22 AM
  2. Combo Store filter strange behavior
    By crxtech in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 15 Jul 2008, 9:23 AM
  3. Grid behavior for Combo box
    By poonam in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 26 Jun 2008, 9:52 AM
  4. Issue with Combo Box behavior within a form that is within a tab
    By johnbarbic in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Apr 2008, 11:14 PM
  5. 1.0[b1] JSONReader Combo Box Strange Behavior
    By jon.whitcraft in forum Ext 1.x: Bugs
    Replies: 6
    Last Post: 9 Apr 2007, 11:19 PM

Thread Participants: 1