Results 1 to 2 of 2

Thread: [Solved] ComboBox options dissapear when one is selected

  1. #1
    Ext User
    Join Date
    Aug 2007
    Vote Rating

    Default [Solved] ComboBox options dissapear when one is selected

    I'm having a lot of trouble setting up a combobox. I got it to finally display the data using a JsonStore but I have to run combobox.setValue() for it to actually work, otherwise clicking on the arrow for the combobox displays nothing. Well, even with that it keeps fetching the data each time the dropdown is clicked. I don't want this, and I assumed it had to do with mode: 'remote' being default so I set it to local. Local also fixes fixes it so I don't have to do combobox.setValue() for it to display the options when the arrow is clicked. The only problem is that after the user makes a selection, the dropdown will only show the selection made and all other options are gone. Here is my code for the combobox and form, I have kept out all other field declarations.

    PHP Code:
            var field_category_store = new{
                url: "<?=site_url('admin/category/get/json/'?>/" + (new Date().getTime()),
                fields: ['id', 'name']
            var field_category = new Ext.form.ComboBox({
                store: field_category_store,
                fieldLabel: 'Category',
                valueField: 'id',
                displayField: 'name',
                hiddenName: 'category_id',
                emptyText: 'Select a category...',
                mode: 'remote',
                allowBlank: false,
                forceSelection: true
            var product_form = new Ext.form.Form({
                labelAlign: 'right'
            product_form.column({width: 430, labelWidth:120, style:'margin-left:8px;margin-top:8px'});
                {id:'desc', legend:'Fill the form to create a new product'},
            field_category_store.baseParams['disableCaching'] = true;
            //field_category_store.on('load', function() {field_category.setValue(14);}, this, {single: true});
    I commented the on load listener for the category store because with mode: local I don't have to do this.

    Why do all other options disappear once one is selected?

    Thanks again

    EDIT: I would also like to poitn out that I am disabling caching because the application I am writing has URLs for better SEO, therefore the ?_dc=<timestamp> breaks the request.
    Last edited by jfanaian; 7 Aug 2007 at 7:23 AM. Reason: moved to Help from General

  2. #2
    Ext User
    Join Date
    Aug 2007
    Vote Rating


    Well, I was looking through the examples in the docs to see if there was anything different to what I was doing and I found the solution. I had to add

    triggerAction: 'all'

    To the combobox.

    It works! How awesome

Posting Permissions

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