Results 1 to 6 of 6

Thread: Combo not load

  1. #1

    Default Combo not load

    I have this code

    Code:
                 Ext.onReady(function() {
                 
                    var myDataStore = new Ext.data.Store({
                        proxy: new Ext.data.HttpProxy({
                            url: myExtHelper.hostname + '/Pages/Data/Category.aspx',
                            method: 'GET'                        
                        }),
                        baseParams: {
                                f: 'Combo'
                        },                   
                        reader: new Ext.data.XmlReader ({record: 'CmsCategory'}, ['IDCategory', 'Category'])}
                    );   
                    
                    myDataStore.load();                
                                 
                    Ext.getCmp('cmbCategory').store = myDataStore;
                    Ext.getCmp('cmbCategory').hiddenName = 'IDCategory';
                    Ext.getCmp('cmbCategory').displayField = 'IDCategory';
                    Ext.getCmp('cmbCategory').valueField = 'Category';                
                    
                 });
    and return this xml

    [CODE]
    <CMS>
    <CmsCategory>
    <IDCategory>1</IDCategory>
    <Category>Apresenta

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    How do you know it 'does not load' ? Loading is asynchronous, so the data won't be ready after you call load!

    Here are some general pointers:
    1. Is the encoding of the xml file text/xml or application/xml ?
    2. store, hiddenName, displayField and valueField are not writeable properties, they are config options. They should be set in the constructors config parameter!

  3. #3

    Default

    I changed my code to remove all properties of cmbCategory and changed to config in json parameters but continue not loading.

    My xml data is of type text/xml

  4. #4

    Default

    Problem solved.

  5. #5

    Default How did you fix this?

    Can you post your solution as this may help others including myself.

  6. #6

    Default

    Quote Originally Posted by mwh154 View Post
    Can you post your solution as this may help others including myself.

    I included in my combo json config this items:

    Code:
    {
                    id: 'cmbCategory',
                    xtype: "combo",
                    store: myDataStore,
                    hiddenName: 'IDCategory',
                    displayField: 'Category',
                    valueField: 'IDCategory',
                    fieldLabel: "Text",
                    name: "cmbCategory",
                    typeAhead: true,
                    mode: 'remote',                
                   triggerAction: 'all',                
                    width: '98%'
                  }

Posting Permissions

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