1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    33
    Vote Rating
    0
    Nightwish is on a distinguished road

      0  

    Question [SOLVED] ComboBox not loading data from store

    [SOLVED] ComboBox not loading data from store


    This has been driving me crazy and I cannot see what I am doing wrong... it's going to be some simple setting, I know it. Any help appreciated!

    Code:
    MyComboUi = Ext.extend(Ext.form.ComboBox, {
        fieldLabel: 'Month/Year',
        anchor: '100%',
        store: 'MonthYearStore',
        valueField: 'ID',
        displayField: 'Text',
        hiddenId: 'EpisodeMonthYear',
        hiddenName: 'EpisodeMonthYear',
        mode: 'remote',
        forceSelection: true,
        initComponent: function() {
            MyComboUi.superclass.initComponent.call(this);
        }
    });
    
    SDMonthYearStore = Ext.extend(Ext.data.JsonStore, {
        constructor: function(cfg) {
            cfg = cfg || {};
            StormDatMonthYearStore.superclass.constructor.call(this, Ext.apply({
                storeId: 'MonthYearStore',
                root: 'Data',
                idProperty: 'ID',
                totalProperty: 'TotalCount',
                autoSave: false,
                url: '/sd/api.svc/lookup/MonthYearData',
                autoLoad: true,
                restful: false,
                sortField: 'ID',
                sortDir: 'DESC',
                fields: [
                    {
                        name: 'ID',
                        type: 'string'
                    },
                    {
                        name: 'Text',
                        type: 'string'
                    }
                ]
            }, cfg));
        }
    });
    new SDMonthYearStore();

  2. #2
    Sencha User j-joey's Avatar
    Join Date
    Apr 2008
    Location
    Mersin, Turkey
    Posts
    186
    Vote Rating
    0
    j-joey is on a distinguished road

      0  

    Default


    try setting mode to local

  3. #3
    Sencha User
    Join Date
    May 2010
    Posts
    33
    Vote Rating
    0
    Nightwish is on a distinguished road

      0  

    Default


    Thanks, j-joey! That fixes it but I'd like to understand why "local" works when in reality I am retrieving the data via ajax from a web service? When is "remote" appropriate?

  4. #4
    Sencha User j-joey's Avatar
    Join Date
    Apr 2008
    Location
    Mersin, Turkey
    Posts
    186
    Vote Rating
    0
    j-joey is on a distinguished road

      0  

    Default


    hi,

    as you can see in the source code ( http://www.sencha.com/deploy/dev/doc...mboBox-doQuery ), basically, mode config property tells where the filtering will be done.

    if you choose remote, when you type something on combo it sets baseparams to filter and loads the store.
    if you choose local, it just filters the results.

    that's all...

  5. #5
    Sencha User
    Join Date
    May 2010
    Posts
    33
    Vote Rating
    0
    Nightwish is on a distinguished road

      0  

    Default


    This will take some getting used to - the ext ComboBox is a lot more powerful than a regular dropdown.

Similar Threads

  1. Loading XML data into data.Store into a ComboBox
    By yousefomar in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 14 Jul 2009, 11:34 AM
  2. Combobox Not loading Data from store
    By Jack_S in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 28 Nov 2008, 4:59 AM
  3. in ComboBox to change store loading of data?
    By Hunterman in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 14 Aug 2008, 2:55 AM
  4. loading data into combo box using data store
    By sathishs in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 25 Feb 2008, 5:52 AM
  5. Ext.data.Store - loading data and remembering page state
    By bowmanmc in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 15 Aug 2007, 10:02 AM

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar