1. #1
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default [FIXED][2.1] Bug when a ComboBox is used as an EditorGridPanel editor

    [FIXED][2.1] Bug when a ComboBox is used as an EditorGridPanel editor


    Original thread:

    http://extjs.com/forum/showthread.php?t=39409

    The basis is that when typeahead is enabled, the Combo's Store is filtered to only expose those items which match.

    If the Combo is blurred, and therefore removed in that state, the filter is not cleared.

    So next time the Combo is made visible in the document, and has its value set to the chosen cell value, the Store is still filtered and the value will not be found, so it gets used as the raw value.

    A fix could be changing setValue so that it uses the store unfiltered:

    Code:
    Ext.override(Ext.ComboBox, {
        setValue : function(v){
            var text = v;
            if(this.valueField){
                this.store.clearFilter();
                var r = this.findRecord(this.valueField, v);
                if(r){
                    text = r.data[this.displayField];
                }else if(this.valueNotFoundText !== undefined){
                    text = this.valueNotFoundText;
                }
            }
            this.lastSelectionText = text;
            if(this.hiddenField){
                this.hiddenField.value = v;
            }
            Ext.form.ComboBox.superclass.setValue.call(this, text);
            this.value = v;
        }
    });

  2. #2
    Sencha User
    Join Date
    Dec 2007
    Posts
    69
    Vote Rating
    0
    cblin is on a distinguished road

      0  

    Default


    Hi,

    is there any progress on this one ?

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    It would be very useful if the Ext devs could somehow flag threads that have been added to the internal bug database so we could know that they were at least being considered.

    I've got outstanding bug reports with no response that have dropped back 12 or so pages on the forum folder. I've no idea if they're being looked at.

  4. #4
    Ext User
    Join Date
    May 2008
    Posts
    8
    Vote Rating
    0
    AndrewW is on a distinguished road

      0  

    Default Similar issue...

    Similar issue...


    IMO there is a similar bug when the "editable:false" config option is set on a combo.

    Setting that option is supposed to mean the user can only select items from the list rather than type them in. But in practice it means that once the user has selected an item from the list they cannot then select a different one! This is because Ext filters the list based on their selection and so after the first selection, the only item shown is the item matching their previous selection!

    Somewhere Ext needs to do a this.store.clearFilter();

    A workaround I am using is setting a callback to clear the filter manually:
    Code:
    cmb.on("expand",onExpand);
    function onExpand(){
          this.store.clearFilter();
    }
    
    Last edited by mystix; 7 Jul 2008 at 10:11 PM. Reason: post code in [code][/code] tags. refer to http://extjs.com/forum/misc.php?do=bbcode

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    I think forceSelect: true is what you want for Combos. That way, you can type and get autocomplete, but you can't select any text.

  6. #6
    Ext User
    Join Date
    May 2008
    Posts
    8
    Vote Rating
    0
    AndrewW is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal View Post
    I think forceSelect: true is what you want for Combos. That way, you can type and get autocomplete, but you can't select any text.
    No, forceSelect doesn't do it for me...

    1) I want to have the entire list always displayed to the user when the combo is expanded - like what a normal combobox in most other GUI interfaces (incl html) does. Ext's getting overenthusiastic and filtering things out of the drop-down list based on whatever's currently typed or selected and thus hiding other options from the user.

    2) Ideally I'd like to also prevent the user typing into the combobox and force them just to use the drop-down list (like html comboboxes do). But as soon as editable is set to false (thus preventing them typing and forcing them to use the drop-down list), the filtering means that the list is filtered down to one item as soon as they make a selection, meaning they can't make a different selection.

    Basically, the filtering is an issue, and when editable is set to false the filtering is making the UI unusable.

  7. #7
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    Quote Originally Posted by AndrewW View Post
    No, forceSelect doesn't do it for me...

    1) I want to have the entire list always displayed to the user when the combo is expanded - like what a normal combobox in most other GUI interfaces (incl html) does.
    that would be the triggerAction: 'all' config

  8. #8
    Ext User
    Join Date
    May 2008
    Posts
    8
    Vote Rating
    0
    AndrewW is on a distinguished road

      0  

    Default


    Quote Originally Posted by mystix View Post
    that would be the triggerAction: 'all' config
    Hmm... so it would appear. I did look at that, but I was confused by the docs and had decided it wasn't relevant to what I was trying to do.
    Thanks!

  9. #9
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,545
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    Anyway, the bug reported in this thread still stands.

  10. #10
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    4
    Vote Rating
    0
    brian.moeskau is an unknown quantity at this point

      0  

    Default


    There are several bug reports related to forceSelection that are on our list. I've added this and we'll look into it soon.