1. #1
    Touch Premium Member
    Join Date
    Jul 2010
    Posts
    36
    Vote Rating
    0
    javabee is on a distinguished road

      0  

    Default autoSelect on Combo?

    autoSelect on Combo?


    Hi all, i'm having a couple of problems using the combo for a simpleStore? Combo populates fine but never autoSelects the first element? If i enforce selection though setValue etc then this is fine but if i try to access the value using getValue() it returns the value of the 'displayField' e.g in this case 'first'/'second' etc. If i then select an item from the list and then access the value again using getValue() then it returns 1/2/3 as would be expected? Its almost as if the 'values' are not set until the combo receives a 'select' event?

    Code:
        
    var store = new Ext.data.SimpleStore(
    {
            id: 'testStore',
            fields: ['id','description'],
            data : [['1','first'],['2','second'],['3','third']]
    });
            
    var combo = new Ext.form.ComboBox(
    {
            store: store, 
            displayField: 'description',
            valueField: 'id', 
            mode: 'local' 
    });

  2. #2
    Touch Premium Member
    Join Date
    Jul 2010
    Posts
    36
    Vote Rating
    0
    javabee is on a distinguished road

      0  

    Default


    ok, i understand now that the autoSelect has nothing to do with selecting the first result or item in the results array. I then thought i'd found another user with the same problem at
    http://www.sencha.com/forum/showthre...e+displayValue

    Similar issue but the solution didn't work for me, i've tried using the ArrayStore in place of the SimpleStore but still not getting a fix

  3. #3
    Sencha User
    Join Date
    Jan 2009
    Location
    Weinstadt
    Posts
    23
    Vote Rating
    1
    Graveworm is on a distinguished road

      0  

    Default


    Maybe this helps.

    PHP Code:
    forceSelection Boolean 

  4. #4
    Ext User
    Join Date
    Dec 2010
    Posts
    10
    Vote Rating
    0
    Danek1313 is on a distinguished road

      0  

    Default


    If you just want your combobox to show the first item, you can just manually hard code it like this:

    PHP Code:
    var combo = new Ext.form.ComboBox(
    {
            
    storestore
            
    displayField'description',
            
    valueField'id'
            
    mode'local' ,
            
    value'1'
    }); 
    Last edited by Danek1313; 17 Dec 2010 at 8:22 AM. Reason: Not sure how to highlight within code block

Similar Threads

  1. [CLOSED] combo autoSelect doesn't work with ArrayStore
    By PaloAltoNetworks in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 14 Dec 2010, 2:16 AM
  2. Why combobox can't do autoselect?
    By freezq in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 11 Aug 2010, 3:11 PM
  3. Autoselect on combobox
    By Shenryu in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 19 Oct 2009, 2:29 AM
  4. Help with combobox autoselect
    By gvargas in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 2 Jun 2009, 8:11 AM
  5. How to autoselect the first element in a combobox?
    By ryanslade in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 9 Aug 2007, 4:39 PM

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi