1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    39
    Vote Rating
    0
    cdiscla is on a distinguished road

      0  

    Default How to set value for a combobox bound to a store?

    How to set value for a combobox bound to a store?


    Hello
    i have a combobox that contains the list of my app's user declared as follows:

    xtype:'combobox',
    fieldLabel: 'Username',
    name: 'id_user',
    displayField:'name',
    valueField:'id_user',
    store: UsersStore

    I display the username and send the id to the database; the problem is that i don't know how to set the value when selecting from the db. If i do
    myForm.getForm().findField("id_user").setValue(record.data.id_user);

    I see the id and can't see the correct displayName ... how can i assign the pair id/name to the combo so that it displays the name and sends the id?
    Thanks in advance !

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,572
    Vote Rating
    309
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    setValue should work. If it can't find the value in the store it will just show it in the combobox. Double check that the value you are setting is present in the field id_user in one of the records in your store. Make sure it's a perfect match, including case-sensitivity and data-type (string, number, etc.).

Thread Participants: 1

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