1. #1
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    13
    Vote Rating
    0
    adamb500 is on a distinguished road

      0  

    Default Unanswered: Combo does not show selected value on first drop down

    Unanswered: Combo does not show selected value on first drop down


    Hi all

    I have a problem where a Combo with a valid selection is not actually shown in view the first time it is dropped down.

    The second time the Combo is dropped down, the value is shown fine.

    This modified sample test case indicates the problem. This occurs on IE, Firefox and Chrome, all with ExtJS 4.0.7.

    Any help gratefully appreciated.

    Adam

    Code:
    <script language="javascript">
        Ext.require([
            'Ext.form.field.ComboBox',
            'Ext.form.FieldSet',
            'Ext.tip.QuickTipManager',
            'Ext.data.*'
        ]);
    
    
        Ext.onReady(function () {
            // Define the model for a State
            Ext.define('State', {
                extend: 'Ext.data.Model',
                fields: [
                    { type: 'string', name: 'abbr' },
                    { type: 'string', name: 'name' },
                    { type: 'string', name: 'slogan' }
                ]
            });
    
    
            // The data for all states
            var states = [
                { "abbr": "AL", "name": "Alabama", "slogan": "The Heart of Dixie" },
                { "abbr": "AK", "name": "Alaska", "slogan": "The Land of the Midnight Sun" },
                { "abbr": "AZ", "name": "Arizona", "slogan": "The Grand Canyon State" },
                { "abbr": "AR", "name": "Arkansas", "slogan": "The Natural State" },
                { "abbr": "CA", "name": "California", "slogan": "The Golden State" },
                { "abbr": "CO", "name": "Colorado", "slogan": "The Mountain State" },
                { "abbr": "CT", "name": "Connecticut", "slogan": "The Constitution State" },
                { "abbr": "DE", "name": "Delaware", "slogan": "The First State" },
                { "abbr": "DC", "name": "District of Columbia", "slogan": "The Nation's Capital" },
                { "abbr": "FL", "name": "Florida", "slogan": "The Sunshine State" },
                { "abbr": "GA", "name": "Georgia", "slogan": "The Peach State" },
                { "abbr": "HI", "name": "Hawaii", "slogan": "The Aloha State" },
                { "abbr": "ID", "name": "Idaho", "slogan": "Famous Potatoes" },
                { "abbr": "IL", "name": "Illinois", "slogan": "The Prairie State" },
                { "abbr": "IN", "name": "Indiana", "slogan": "The Hospitality State" },
                { "abbr": "IA", "name": "Iowa", "slogan": "The Corn State" },
                { "abbr": "KS", "name": "Kansas", "slogan": "The Sunflower State" },
                { "abbr": "KY", "name": "Kentucky", "slogan": "The Bluegrass State" },
                { "abbr": "LA", "name": "Louisiana", "slogan": "The Bayou State" },
                { "abbr": "ME", "name": "Maine", "slogan": "The Pine Tree State" },
                { "abbr": "MD", "name": "Maryland", "slogan": "Chesapeake State" },
                { "abbr": "MA", "name": "Massachusetts", "slogan": "The Spirit of America" },
                { "abbr": "MI", "name": "Michigan", "slogan": "Great Lakes State" },
                { "abbr": "MN", "name": "Minnesota", "slogan": "North Star State" },
                { "abbr": "MS", "name": "Mississippi", "slogan": "Magnolia State" },
                { "abbr": "MO", "name": "Missouri", "slogan": "Show Me State" },
                { "abbr": "MT", "name": "Montana", "slogan": "Big Sky Country" },
                { "abbr": "NE", "name": "Nebraska", "slogan": "Beef State" },
                { "abbr": "NV", "name": "Nevada", "slogan": "Silver State" },
                { "abbr": "NH", "name": "New Hampshire", "slogan": "Granite State" },
                { "abbr": "NJ", "name": "New Jersey", "slogan": "Garden State" },
                { "abbr": "NM", "name": "New Mexico", "slogan": "Land of Enchantment" },
                { "abbr": "NY", "name": "New York", "slogan": "Empire State" },
                { "abbr": "NC", "name": "North Carolina", "slogan": "First in Freedom" },
                { "abbr": "ND", "name": "North Dakota", "slogan": "Peace Garden State" },
                { "abbr": "OH", "name": "Ohio", "slogan": "The Heart of it All" },
                { "abbr": "OK", "name": "Oklahoma", "slogan": "Oklahoma is OK" },
                { "abbr": "OR", "name": "Oregon", "slogan": "Pacific Wonderland" },
                { "abbr": "PA", "name": "Pennsylvania", "slogan": "Keystone State" },
                { "abbr": "RI", "name": "Rhode Island", "slogan": "Ocean State" },
                { "abbr": "SC", "name": "South Carolina", "slogan": "Nothing Could be Finer" },
                { "abbr": "SD", "name": "South Dakota", "slogan": "Great Faces, Great Places" },
                { "abbr": "TN", "name": "Tennessee", "slogan": "Volunteer State" },
                { "abbr": "TX", "name": "Texas", "slogan": "Lone Star State" },
                { "abbr": "UT", "name": "Utah", "slogan": "Salt Lake State" },
                { "abbr": "VT", "name": "Vermont", "slogan": "Green Mountain State" },
                { "abbr": "VA", "name": "Virginia", "slogan": "Mother of States" },
                { "abbr": "WA", "name": "Washington", "slogan": "Green Tree State" },
                { "abbr": "WV", "name": "West Virginia", "slogan": "Mountain State" },
                { "abbr": "WI", "name": "Wisconsin", "slogan": "America's Dairyland" },
                { "abbr": "WY", "name": "Wyoming", "slogan": "Like No Place on Earth" }
            ];
    
    
            // The data store holding the states; shared by each of the ComboBox examples below
            var store = Ext.create('Ext.data.Store', {
                model: 'State',
                data: states
            });
    
    
            // Simple ComboBox using the data store
            var simpleCombo = Ext.create('Ext.form.field.ComboBox', {
                store: store,
                fieldLabel: 'Select a single state',
                renderTo: Ext.getBody(),
                displayField: 'name',
                forceSelection: true,
                valueField: 'abbr',
                width: 320,
                labelWidth: 130,
                queryMode: 'local'
            });
    
    
            simpleCombo.setValue('WI');
    
    
        });
    </script>

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,668
    Answers
    3354
    Vote Rating
    746
    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


    With your code and 4.0.7, Wisconsin was selected
    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.

  3. #3
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    13
    Vote Rating
    0
    adamb500 is on a distinguished road

      0  

    Default


    Thanks.

    To confirm:

    You dropped the combo down and the scrollbar went to the bottom of the list showing Wisconsin as the selected item?

  4. #4
    Sencha User
    Join Date
    Feb 2010
    Posts
    125
    Answers
    7
    Vote Rating
    1
    börn is on a distinguished road

      0  

    Default


    Did you try it with 4.1?

  5. #5
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    13
    Vote Rating
    0
    adamb500 is on a distinguished road

      0  

    Default


    Yes, it actually works with 4.1.

  6. #6
    Sencha User
    Join Date
    Feb 2010
    Posts
    125
    Answers
    7
    Vote Rating
    1
    börn is on a distinguished road

      0  

    Default


    yap - suggested that - had a similar issue some time ago... and hopefully ext4.1 is ready before we want to launch our application

Thread Participants: 2

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar