Results 1 to 3 of 3

Thread: Ext.form.ComboBox not populating

  1. #1

    Default Ext.form.ComboBox not populating

    Hi,
    I m populating combobox using Ext.Ajax.request. This way combobox will be populated while the page loads.
    Code:
    this.initAjaxCall = Ext.Ajax.request({	
    url: 'url_of_API',   
     method:'GET',    
    scope : this,    
    success : function(result, request) {    	
      var obj = JSON.parse(result.responseText);   	
      Ext.each(obj.name,function(v){    		
        Ext.getCmp('appCombo').getStore().add({name: v.name});    		
         Ext.getCmp('appCombo').getStore().add({id: v.id});	
    });    
    }});
    This is combobox:
    Code:
    this.appcombo = Ext.create('Ext.form.ComboBox', {	
    id : 'appCombo',	
    emptyText: 'Name', 
    typeAhead: true, 	
    queryMode: 'local',	
    triggerAction: 'all',
    displayField: 'name',	
    valueField: 'id',	
    store: this.appStore
    });
    Finally the store:
    Code:
    var appStore = new Ext.data.ArrayStore({	
    autoLoad: true,	
    fields : ['name','id']
    });
    Onready I'm populating the combox
    Code:
    Ext.onReady (function () {	
    var sampleData = [];
    appStore.load(sampleData);
    appcombo.render('container');
    
    });
    But the dropdown is showing blank. I can see in console the values are populating.
    Please help.

  2. #2

    Default

    It is working when 'Ext.form.ComboBox' is replaced by xtype:'combo',

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Glad to hear that you found your solution, and thanks for sharing. Perhaps it was a timing issue?

Similar Threads

  1. ComboBox not populating
    By robowen in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 12 Sep 2014, 11:01 AM
  2. Help populating a combobox
    By djbrady in forum Ext GWT: Discussion
    Replies: 3
    Last Post: 10 Aug 2011, 8:59 AM
  3. Form fields not populating after a successful form.load()
    By TampaBay55 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 1 Jan 2011, 5:44 AM
  4. Replies: 2
    Last Post: 30 Sep 2010, 6:56 AM
  5. Populating Combobox
    By winklerd in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 27 Aug 2010, 12:49 PM

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
  •