Results 1 to 5 of 5

Thread: ComboBox problem

  1. #1

    Exclamation ComboBox problem

    Hi. I have problem with ComboBox when server returns empty value for it. Here is how I set it up:
                var form = new Ext.form.FormPanel({
                    baseCls: 'x-plain',
                    labelWidth: 55,
                    defaultType: 'textfield',
                    reader : new{
                            record : 'record'
                        }, [ 'id', 'name', 'code', 'desc', 'tcode']
                    items: [{
                        xtype: 'hidden',
                        name: 'id'
                        fieldLabel: 'Code',
                        name: 'code',
                        anchor: '100%'
                        fieldLabel: 'Name',
                        name: 'name',
                        anchor:'100%'  // anchor width by percentage
                        xtype: 'combo',
                        fieldLabel: 'Type',
                        name: 'tcode',
                        anchor: '100%',
                        editable: false,
                        displayField: 'text',
                        lazyInit : false,
                        emptyText : 'Select type',
                        forceSelection : true,
                        store: new{
                            url: 'DataUManage.dat?m_type=data_gen_types&m_filt=UserGroup',
                            fields: ['id', 'text'],
                            autoLoad : true
                    }, {
                        xtype: 'textarea',
                        hideLabel: true,
                        name: 'desc',
                        anchor: '100% -83'  // anchor width by percentage and height by raw adjustment
    Im using this to edit or create some object. It works fine when ComboBox reader gets data for existing object in the DB. Problem is when server returns empty values for all fields in the form. In that case ComboBox is empty (as I want it to be) but when I click on the drop-list arrow nothing happens. All is working fine when server returns values for existing object. It almost feels that if value is not belongs to the list then ComboBox is stuck and dont allow you to pick anything.

  2. #2


    do u find that you have 2 'id's in your code?,but they are different thing:
    reader : new{
    record : 'record'
    }, [ 'id', 'name', 'code', 'desc', 'tcode']
    store: new{
    url: 'DataUManage.dat?m_type=data_gen_types&m_filt=UserGroup',
    fields: ['id', 'text'],
    autoLoad : true

  3. #3


    Not sure Im following. Top one is mapping for reading form fields and bottom for reading list for the ComboBox.

  4. #4
    Sencha User
    Join Date
    Mar 2007
    The Netherlands


    What exactly is an 'empty' value (I would recommend to use '' or null and not undefined).

    You probably also need this fix for ComboBox.

  5. #5


    Thank you! Apparently setting triggerAction: 'all' did the trick.

Posting Permissions

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