[CLOSED] [1.1] Template Combobox typeahead value select the first row

  1. #1

    [CLOSED] [1.1] Template Combobox typeahead value select the first row

    Hello,

    When you use typeahead in combobox it selects the first row :

    Exemple :
    https://examples1.ext.net/#/Form/ComboBox/Two_Columns/

    1. Type "alas" ;
    2. It will hilight "Alabama" and replace the value "alas" by "alabama" in the text field of the combo box...


    How can i fix this, have you a workaround ?

    FIXED: See #4 to fix this pb

    Thank you!
    Last edited by Daniil; Sep 28, 2011 at 2:22 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Reproduced and investigating.
  3. #3
    I just discovered if I even type any text it selects "Alabama" anyways.

    Hmm, Ext.form.ComboBox .onTypeAhead() looks very strange.
    onTypeAhead : function(){
        if(this.store.getCount() > 0){
            var r = this.store.getAt(0);
            var newValue = r.data[this.displayField];
            var len = newValue.length;
            var selStart = this.getRawValue().length;
            if(selStart != len){
                this.setRawValue(newValue);
                this.selectText(selStart, newValue.length);
            }
        }
    }
    I'm not sure why it always uses the first record.
    var r = this.store.getAt(0);
    Needs some further investigation.
  4. #4
    To fix please set up Mode="Local" for the ComboBox.

    We will fix it in SVN and the online sample.

    Thanks for the report.
  5. #5
    Probably because the store must be filtered before and contain the elements corespond the text write:

    [Al________]
    |Alabama
    |Alaska

    And not :
    [Al________]
    |Alabama
    |Alaska
    |Arizona
    |etc...

    In this case it's logic to take the first choice.

    The default behavior is to not filter the list. You understant what i explain ?
  6. #6
    Absolutely, you are right.

    Please see my previous post.
  7. #7
    Quote Originally Posted by Daniil View Post
    To fix please set up Mode="Local" for the ComboBox.

    We will fix it in SVN and the online sample.

    Thanks for the report.
    There is another problem :
    With Local mode :
    1. Type "alas" - It will hilight "alaska" it's Ok ;
    2. Type ENTER
    3. The value is change by "Alabama"... It's very strange...
  8. #8
    I can't reproduce.

    Do you use the online example?
    https://examples1.ext.net/#/Form/ComboBox/Two_Columns/
  9. #9
    Okay, excuse me. The error was coming from my application. I fixed my bug and everything works!

    Thank you very much for the quick response!

    See you soon,

Similar Threads

  1. [CLOSED] TypeAhead databound combobox
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jun 27, 2012, 1:28 PM
  2. [CLOSED] Combobox TypeAhead
    By blurken in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: May 18, 2012, 1:46 AM
  3. Replies: 4
    Last Post: Sep 28, 2011, 8:57 AM
  4. [CLOSED] ComboBox value resets after typeAhead does not return a match
    By joeRobee in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jan 06, 2011, 2:54 PM
  5. [CLOSED] [1.0] ComboBox Template
    By state in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 25, 2010, 5:36 PM

Posting Permissions