1. #1
    Sencha User
    Join Date
    Mar 2009
    Posts
    43
    Vote Rating
    0
    yumusakg is on a distinguished road

      0  

    Default Unanswered: How can I display combobox text after form load?

    Unanswered: How can I display combobox text after form load?


    I can post the value of remote combobox with hiddenName. I couldn't accomplish showing the text of combobox after form load. This is a remote combo. So the store is not loaded after form load. So the combo only shows the value field...

    config for combobox
    Code:
    Ext.ns('portal', 'portal.common');
    
    portal.common.store_combo_company = new Ext.data.JsonStore({
        root: 'data',
        url: '../common/presentation/commondata.aspx',
        baseParams: {
            cmd: 'combo_company'
        },
        fields: [{
            name: 'ParamID',
            type: 'int'
        },
        {
            name: 'ParamDescription',
            type: 'string'
    }]
        });
    
        portal.common.ComboCompany = Ext.extend(Ext.form.ComboBox, {
            constructor: function(config) {
                config = Ext.apply({
                    store: portal.common.store_combo_company,
                    valueField: 'ParamID',
                    displayField: 'ParamDescription',
                    fieldLabel: 'Firma',
                    mode: 'remote',
                    typeAhead: false,
                    triggerAction: 'query',
                    minChars: 2
                }, config);
    
                portal.common.ComboCompany.superclass.constructor.call(this, config);
            }
        });
    
        Ext.reg('combocompany', portal.common.ComboCompany);
    apart from form's config
    Code:
    {
                id: 'form_contract',
                url: 'prcdata.aspx',
                xtype: 'form',
                baseCls: 'x-plain',
                labelWidth: 120,
                bodyStyle: 'padding:10px',
                defaults: { anchor: '100%', xtype: 'textfield' },
                items: [{
                    fieldLabel: 'contractId',
                    name: 'contractId',
                    xtype: 'hidden'
                }, {
                    id: 'prc_firma',
                    xtype: 'combocompany',
                    emptyText: 'Seçiniz',
                    hiddenName: 'Firma'
                }]
    }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Answers
    3462
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If the store hasn't finished loading when you set a value to the combo then you will need to reset the value once the store has finished loading.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

  3. #3
    Sencha User
    Join Date
    Mar 2009
    Posts
    43
    Vote Rating
    0
    yumusakg is on a distinguished road

      0  

    Default


    the combo retrieves 5000 rows. so i don't want to load these rows in form load... what i wanted to make is displaying combo value and text without loading combo store...

  4. #4
    Ext JS Premium Member
    Join Date
    Jan 2008
    Location
    Germany, Berlin
    Posts
    135
    Answers
    21
    Vote Rating
    11
    fschaeffer will become famous soon enough

      0  

    Default


    You could use setRawValue to simply display the value you want.

    I usally use a combination of setValue & setRawValue. So the combobox IS aware of the to-be-used-value and correctly transmits the value but without loading the store...

    HTH
    Florian

  5. #5
    Sencha User
    Join Date
    Mar 2009
    Posts
    43
    Vote Rating
    0
    yumusakg is on a distinguished road

      0  

    Default


    thank you @fschaeffer,

    setRawValue worked very well.

    But it is extra code to implement this common requirement.. I think this must be functionality of combo component. An additional config item like loadValue which will bind the action.result.data.<data_item> to combobox RawValue could be easily implemented.. so we didn't have to write extra code..

Thread Participants: 2

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..."