You found a bug! We've classified it as EXTJS-5565 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Ext JS Premium Member
    Join Date
    May 2009
    Posts
    41
    Vote Rating
    0
    maksimenko is on a distinguished road

      0  

    Default ComboBox and assertValue

    ComboBox and assertValue


    Hello there,

    Having forceSelection: true & multiSelect: false on a combo, when there is more than one record with the same display field value, the assertValue function always re-select the first one, no matter which record (with the same display field value) you select.

    The problem is that assertValue is using 'findRecordByDisplay'
    Code:
    ...
    rec = me.findRecordByDisplay(value);
    if (rec) {
          me.select(rec);
    }
    ...
    the change event has the correct newValue, the problem is that the assertValue modify it to another value (the first one with that display value)

    I know its not very common to have more than one record with the same display value (obviously the records have different id values)... In my case, I hit this problem with people, it's possible that more than one person is named the same, and they represent different records.... (in my system they are easily differentiable because I'm using a custom innerTpl that not only shows the person name, but also its email, if it's an employee or a contact and it's avatar)

    Currently, I'm overriding the combobox to avoid the me.select(rec), and it works OK for me... but I guess it would be better if I didn't have to include that override...

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,620
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Not common but a possibility. Thanks for the report.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1