You found a bug! We've classified it as EXTJS-3298 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #11
    Sencha User pierrocknroll's Avatar
    Join Date
    Aug 2011
    Posts
    36
    Vote Rating
    -3
    pierrocknroll can only hope to improve

      0  

    Default


    Well no, within the test case and 4.0.7 it works fine..
    So the bug is back in 4.1.0

  2. #12
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    61
    Vote Rating
    4
    ap is on a distinguished road

      0  

    Default


    Hmmm, it was not working for me under 4.0.7 (this case was never closed either).

    Anyways, you are right, this is still a problem in 4.1.0

    Here is the updated test case
    Code:
    <html>
    <head>
        <title>ExtJs 4.1 - combobox setValue bug</title>
        <!-- Ext includes -->
        <link rel="stylesheet" type="text/css" href="http://dev.sencha.com/deploy/ext-4.1.0-gpl/resources/css/ext-all.css" />
        <script type="text/javascript" src="http://dev.sencha.com/deploy/ext-4.1.0-gpl/ext-all.js"></script>
        
    	<script type="text/javascript">
    Ext.Loader.setConfig({
        enabled: true
    });
    
    
    Ext.require([
        'Ext.form.field.ComboBox',
        'Ext.form.FieldSet',
        'Ext.tip.QuickTipManager',
        'Ext.data.*'
    ]);
    
    Ext.onReady(function() {
        Ext.tip.QuickTipManager.init();
    
        // Define the model for a State
        Ext.define('State', {
            extend: 'Ext.data.Model',
            fields: [
                {type: 'string', name: 'abbr'},
                {type: 'string', name: 'name'},
                {type: 'int', name: 'id'}
            ],
    	idProperty: 'id'
        });
    
        // The data for all states
        var states = [
            {"abbr":"AL","name":"Alabama","id":1},
            {"abbr":"AK","name":"Alaska","id":2},
            {"abbr":"AZ","name":"Arizona","id":3},
            {"abbr":"AR","name":"Arkansas","id":4},
            {"abbr":"CA","name":"California","id":5}
        ];
    
        // 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', {
            fieldLabel: 'Select a single state',
            renderTo: Ext.getBody(),
            displayField: 'name',
            width: 320,
            labelWidth: 130,
            store: store,
            queryMode: 'local',
            typeAhead: true,
    	valueField: 'id',
    	displayField: 'abbr'
        });
    
        Ext.create('Ext.Button', {
    	text: 'Set Value with quote',
    	renderTo: Ext.getBody(),
    	handler: function() {
    	    simpleCombo.setValue('2');
    	    alert("simpleCombo.setValue('2');");
    	}
        });
        
        Ext.create('Ext.Button', {
    	text: 'Set Value without quote',
    	renderTo: Ext.getBody(),
    	handler: function() {
    	    simpleCombo.setValue(4);
    	    alert("simpleCombo.setValue(4);");
    	}
        });
    });
    
    	</script>
    </head>
    <body>
        <form id="history-form" class="x-hide-display">
        <input type="hidden" id="x-history-field" />
        <iframe id="x-history-frame"></iframe>
    </form>
    </body>
    </html>

  3. #13
    Sencha User
    Join Date
    Jun 2008
    Posts
    138
    Vote Rating
    7
    jchau is an unknown quantity at this point

      0  

    Default


    Will this be fixed ever? I just spent about 5 hours debugging an upgrade issue because of this.

  4. #14
    Sencha User pierrocknroll's Avatar
    Join Date
    Aug 2011
    Posts
    36
    Vote Rating
    -3
    pierrocknroll can only hope to improve

      0  

    Default


    Bug still exists in 4.2...