1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
    jfmateos2 is on a distinguished road

      0  

    Default Answered: Combobox does not show selected value

    Answered: Combobox does not show selected value


    I have a first combobox with a change event listener.
    When the user selects a value in this first combobox, its change listener creates a second combobox (propiedad) and assigns it the following store:

    Code:
    propiedad.store=Ext.create('Ext.data.Store', {                                   
       fields: ['valor'],                                    
       data : [{'valor':'HOME'},{'valor':'WORK'}]
    });
    propiedad.displayField= 'valor';        
    propiedad.valueField= 'valor';
    propiedad.setEditable(false);
    The second combobox, when dropped-down, shows the options HOME and WORK properly, but when I click on either of these options, the combobox drops-up but remains empty, although I know that the value has been assigned through a alert(propiedad.value) in the change listener of this second combobox.

    ¿Why the combobox does not show the selected value?
    Last edited by jfmateos2; 22 Nov 2011 at 10:15 AM. Reason: errata

  2. You shouldn't change the valueField or displayField after instantiation.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    438
    Answers
    3113
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    You shouldn't change the valueField or displayField after instantiation.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

    When posting code, please use BBCode's CODE tags.