Results 1 to 7 of 7

Thread: Combo Box not loading value

  1. #1
    Sencha User
    Join Date
    Sep 2013
    Posts
    68
    Vote Rating
    2
      0  

    Default Combo Box not loading value

    I am trying to retrieve the values from database to display on the combo box. Here's my code

    combo:
    xtype:'combobox',
    queryMode: 'local',
    store: new dlti.store.ClientListStore(),
    displayField: 'username',
    valueField: 'id',
    name: 'client-list',
    editable: false
    Store:
    Ext.define('dlti.store.ClientListStore', {
    extend: 'Ext.data.Store',
    model: 'dlti.model.ClientListModel',
    proxy: {
    type: 'memory',
    autosync: true,
    reader: {
    type: 'json',
    root: 'result'
    }
    }
    });
    model:
    Ext.define('dlti.model.ClientListModel', {
    extend: 'Ext.data.Model',
    fields: [
    {name: 'id', type: 'string'},
    {name: 'username', type: 'string'},
    ]
    });

  2. #2
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,101
    Answers
    113
    Vote Rating
    100
      0  

    Default

    you shouldnt be using queryMode: 'local'. if you remove it then it should work.

    http://docs.sencha.com/extjs/4.2.1/#...-cfg-queryMode

  3. #3
    Sencha User
    Join Date
    Sep 2013
    Posts
    68
    Vote Rating
    2
      0  

    Default

    Still not working. :\

  4. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,234
    Answers
    756
    Vote Rating
    1015
      0  

    Default

    You specified a memory proxy, don't want want an ajax proxy to query the server?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  5. #5
    Sencha User
    Join Date
    Sep 2013
    Posts
    68
    Vote Rating
    2
      0  

    Default

    I'm using memory proxy the whole time. And it's the default proxy we're using in our framework.

  6. #6
    Sencha User
    Join Date
    May 2013
    Posts
    20
    Answers
    2
    Vote Rating
    4
      0  

    Default

    As you are using a memory proxy (which doesn't fetch data from an url), you should provide us with some code on how you insert data into your store?

    I'd suggest you take a look at the ajax proxy in the docs. You should use this one instead of your memory proxy. Here is some example, i took the liberty to just edit your code a bit.

    Code:
    Ext.define('dlti.store.ClientListStore', {
    extend: 'Ext.data.Store', model: 'dlti.model.ClientListModel', proxy: {
    type: 'ajax', url: 'your sync url', autosync: true, reader: {
    type: 'json', root: 'result'
    }
    }
    });

  7. #7
    Sencha User
    Join Date
    Sep 2013
    Posts
    68
    Vote Rating
    2
      0  

    Default

    EDIT*

    I was finally able to retrieve my data from the database to my combobox. Sorry guys, My codes were already right but I wrote my the code in the wrong event that's why it's not doing anything. Thank you for all the help. And btw, I still used the queryMode: 'local' and it's running.

Tags for this Thread

Posting Permissions

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