Results 1 to 4 of 4

Thread: ExtJS Combobox select and store load problem

  1. #1
    Ext JS Premium Member
    Join Date
    Dec 2011
    Location
    Mississauga, Canada
    Posts
    38

    Default Answered: ExtJS Combobox select and store load problem

    Hi,

    I have a store with load listener,

    var mystore = Ext.create('Ext.data.Store',
    {
    model : 'myList',
    autoLoad : false,
    storeId : 'MyStore',
    listeners :
    {
    'load' : function (store, records, options) {
    // I load another store here
    }
    }, scope : this
    }


    I also have a combobox which uses this store and has a select listener,

    // var fleets = Ext.create('Ext.form.field.ComboBox',
    var fleets = Ext.create('Ext.form.ComboBox',
    {
    store : 'MyStore',
    displayField : 'Name',
    valueField : 'Id',
    typeAhead : true,
    fieldStyle : 'cmbfonts',
    labelCls : 'cmbLabel',
    mode : 'local',
    triggerAction : 'all',
    fieldLabel : ' Names ',
    emptyText : 'nothing to display',
    tooltip : 'Select group of names to show',
    selectOnFocus : true,
    width : 300,
    labelWidth : 40,
    listeners :
    {
    'select' : function (combo, value) {
    }
    }



    I load the mystore via mystore.load and than it inturn loads Combobox. Which is expected behaviour,

    but than when I select default item in combo box for first time , I see my store loads again (I can see in firebug) as well as my store load events messages. This gives bad user experience,

    Why is this happening while I already have the store loaded and combo has data.

    Please reply if I am doing something wrong. Please reply how to fix the issue.

    Thanks,
    Shehul

  2. rename mode to queryMode

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    rename mode to queryMode
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Ext JS Premium Member
    Join Date
    Dec 2011
    Location
    Mississauga, Canada
    Posts
    38

    Default

    Thank you mitchellsimoens, you saved my lot time.


  5. #4
    Sencha User
    Join Date
    Mar 2013
    Posts
    12

    Default

    Hi mitchellsimoens,

    I am running into a combobox related issue any suggestion will be highly appreciated,

    My problem is right now i am using linked combobox in my grid with static store for that combobox column alone data is coming from a static store and for other columns in grid data is coming from another store it is working fine now below is the code i am using for that,

    LCombo.items = [
    ['item1', 'item1'],
    ['item2', 'item2'],
    ['items3', 'item3'],
    ['item4', 'item4'],

    ];

    LCombo.description = [
    [1, 'item1', 'item11'],
    [2, 'item1', 'item12'],
    [3, 'item1', 'item13'],
    [4, 'item2', 'item21'],
    [5, 'item2', 'item22'],

    ];

    var itemstore = new Ext.data.SimpleStore
    ({
    fields: ['columnId', 'columnName'],
    data: LCombo.items
    });

    var descstore = new Ext.data.SimpleStore
    ({
    fields: ['id', 'cid', 'linkedcolumnName'],
    data: LCombo.description
    });


    Now i am using this static store(itemstore, descstore) in linked comboboxs, now i want to replace this static store with a store where the data is coming from database to that store.

    I am almost all spent so munch time on this so please help out from this

    Thanks in advance

Posting Permissions

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