Results 1 to 3 of 3

Thread: ComboBox with static store is blank sometimes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha Premium User
    Join Date
    Apr 2011
    Posts
    106
    Answers
    1

    Default ComboBox with static store is blank sometimes

    Ext JS 6.5.3

    I am having trouble tracking down an issue where sometimes a combobox on a form or grid is blank/empty when the store is tied to a static list. I have multiple stores with static data that are used for comboboxes. The combos are not always blank but often enough where it's an issue. Here is how I have things defined.

    Store:
    Code:
    Ext.define('Designer.store.system.DBTypeStore', {
        extend: 'Ext.data.Store',
        storeId: 'dbtypestore',
        
        fields: ['dbType', 'name'], 
        
        data: [
               {dbType: 'AS400', name: 'AS400'},
            {dbType: 'MSSQL', name: 'SQL Server'},
            {dbType: 'ODBC', name: 'ODBC'},
            {dbType: 'ORACLE', name: 'Oracle'}
        ]
    
    });
    Form:
    Code:
            items: [{
                name: 'devdbtype',
                xtype: 'combobox',
                   fieldLabel: 'DB Type',
                store: 'dbtypestore',
                valueField: 'dbType',
                displayField: 'name',
                typeAhead: true,
                forceSelection: true,
                queryMode: 'local',
                bind: {readOnly: '{readOnly}'}                
            },{
    Example:
    blank_combo.png

    Any ideas on why this is happening would be greatly appreciated.

    Thank you
    Rudy

  2. #2
    Sencha User
    Join Date
    Feb 2017
    Posts
    15
    Answers
    3

    Default

    The code you provided needs store to be instantiated to be reachable for combo. Why don't you use alias and write it in combo > store > type.

    https://fiddle.sencha.com/#view/editor&fiddle/2lmp

  3. #3
    Sencha Premium User
    Join Date
    Apr 2011
    Posts
    106
    Answers
    1

    Default

    Thanks for the fiddle. Question, using the syntax you used in the combo to define the store is the store "auto" instantiated? I have 10+ stores like this used in combo boxes all over my app. I have code within my login script where I am loading a bunch of other stores (post login), I am thinking I could use Ext.create("storename") in this same area to instantiate all the combo stores, this would be an easier implementation for me right now. Would this accomplish the same thing?

    Thanks again.

Similar Threads

  1. Binding combobox to static store
    By vaughanje in forum Ext 5: Q&A
    Replies: 2
    Last Post: 16 Mar 2015, 12:33 PM
  2. Ext Designer, Combobox, set blank value in the JSON store.
    By jinahadam in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 9 Jul 2011, 11:13 PM
  3. Replies: 4
    Last Post: 28 Mar 2010, 11:52 AM
  4. Store is Loaded but Combobox is blank ?
    By srajakaruna in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 27 Aug 2008, 6:12 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
  •