Results 1 to 2 of 2

Thread: Combobox does not show selected value

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You shouldn't change the valueField or displayField after instantiation.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

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