Results 1 to 3 of 3

Thread: ComboBox with well conigured store send displayField instead valueField

  1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    95

    Default ComboBox with well conigured store send displayField instead valueField

    Hey

    I have this code :

    Code:
    var languageCombo = new Ext.form.ComboBox({
            fieldLabel: tr('j?zyk interfejsu'),
            store: new Ext.data.ArrayStore({
                fields: ['language', 'name'],
                data: [['pl', tr('polski')],['en',tr('angielski')],['ru', tr('rosyjski')]]
            }),
            valueField: 'language',
            displayField: 'name',
            name: 'language',
            mode: 'local',
            triggerAction: 'all',
            editable: false
        });
        var overalDataPanel = new Ext.form.FormPanel({
            title: 'Oglne',
            padding: 4,
            buttonAlign: 'center',
            border: false,
            defaults: {anchor: '95%'},
            items : [emailField, mobileFiled, languageCombo],
            buttons: [
                {text: tr('Zapisz'), handler: function(){
                        var form = overalDataPanel.getForm();
                        //console.log(languageCombo.getValue());
                        if(form.isValid()){
                            form.submit({
                                url: App.baseUrl + '/user/update-user-settings',
                                params: {id: config.id, lang: languageCombo.getValue()},
                                success: function(form,action) {
                                    VCC.Info(tr('Dane zapisane pomy?lnie'))
                                },
                                failure: function(form,action){
                                    Ext.MessageBox.alert('Erro','Error');
                                }
    
                            });
                        }
                    }
                },
                {text: tr('Zamknij'), handler: function(){
                        self.close();
                    }
                }
            ]
    //some other code here
    });
    And after I am submitting the form than POST looks like this :

    email [email protected]
    id 1926
    lang pl
    language polski
    mobile 48505190943
    So in language POST param instead of valueField the displayField is sent

    any ideas why ?

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    name: 'language' -> hiddenName: 'language'

  3. #3
    Sencha User
    Join Date
    Dec 2009
    Posts
    95

    Default

    Thanks Condor

Similar Threads

  1. Posting a ComboBox will send the displayField instead valueField
    By junkzilla in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 18 Feb 2009, 11:43 AM
  2. Store valueField and displayField
    By psambhus in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 3 Jun 2008, 1:10 AM
  3. Accessing store's valueField from the displayField
    By jorgeville in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 3 May 2008, 12:04 PM
  4. ComboBox send displayField, not valueField
    By ieroglif in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 10 Apr 2008, 2:51 PM
  5. Replies: 1
    Last Post: 24 Mar 2008, 2:15 AM

Posting Permissions

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