Results 1 to 2 of 2

Thread: combobox displayField duplicate Value Problem

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Location
    Korea
    Posts
    8
    Answers
    1
    Vote Rating
    0
      0  

    Default Answered: combobox displayField duplicate Value Problem

    Hi,

    I'm using extjs 4.1

    This problem is Comboboxs Store Data displayField Value Duplicate select
    and out of focus by Combobox worked change event then
    auto select change first duplicate value ..


    Code:
    {
        xtype: 'combobox',
        width: 160,
        id : "sms_itemCode",
        name : "itemCode",
        fieldLabel: '',
        labelAlign: 'right',
        "store": itemSimple_List,
        "valueField": 'valueData',
        "displayField": 'viewData',
        "typeAhead" : true,
        "transform" : 'stateSelect',
        "forceSelection" : true,
        "queryMode": 'local',
            allowBlank : false,
        disabled: true,
        x: 775,
        y: 20,
        "doQuery" : function(queryString, forceAll) {
            this.expand();
            this.store.clearFilter(!forceAll);
    
    
            if (!forceAll) {
                this.store.filter(this.displayField,queryString);
            }
        },
        listeners : {
            change : function(combo, newval, oldval, eOpts){
                console.log(newval);
                console.log(oldval);
                console.log(eOpts);
                this.getStore().clearFilter(true);
            }
        }
    }

    EX > store Data ValueField, DisplayField
    [ {1, "comp"},
    {2, "comp"} ]
    I select 2, comp then auto change 1, comp

    console logs

    1040100113 <-- select combobox Item
    comp <-- display value (autocomplite oldval)
    Object <-- eOpts

    1040100112 <-- out of focus auto change

    Thanks in advanced.

  2. The displayField values need to be unique as well

  3. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,029
    Answers
    3976
    Vote Rating
    1368
      0  

    Default

    The displayField values need to be unique as well
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •