1. #1
    Ext User
    Join Date
    Sep 2007
    Vote Rating
    bowa is on a distinguished road


    Default Combobox with default value

    Combobox with default value

    I am adding a combobox to a fieldset

    			items :[{
    				xtype: 'combo',
    				fieldLabel: 'Address',
    				hiddenName: 'shipment-' + number + '-addr',
    			    store: addrStore,
    			    tpl: resultTpl,
    			    triggerAction: 'all',
    			    value: addressId,
    			    emptyText:'Select an address...',
    it get the adresses from a store that gets its data using a DWRProxy, it uses XTemplate to display a nice list of the adresses and when i post the form, the 'id' of the address gets posted. All that is working as intended.

    The problem i have is when i want to set the value, (the address has been chosen before), i know the 'id' and its stored in variable 'addressId', so i thought i could use

    value: addressId,
    but that sets the numerical id to the displayField instead of the 'friendly' value from the corresponding record. (but these records are not loaded yet, the store gets filled when you hit the trigger ...)

    what is the best solution for this ?

  2. #2
    Sencha User catacaustic's Avatar
    Join Date
    Jul 2007
    "A Land Down Under"
    Vote Rating
    catacaustic is on a distinguished road



    The best solution that I can think of for this would be to not set the value before the store is loaded as you are trying to do there. As you've found, that doesn't work if the records aren't loaded yet.

    I'd set up a listener for the 'load' event of the store that check what the current selection is (that should be 'addressId' in your case) and sets that whenever the store is loaded. That way you can still get the value in there and you aren't left with this strange number that no one will recognise in there beforehand.
    'Once again, fortune vomits on my eiderdown'
    - Edmund Blackadder

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