Results 1 to 4 of 4

Thread: Can an Ext.List share a panel with other components?

  1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    28
    Vote Rating
    0
      0  

    Default Answered: Can an Ext.List share a panel with other components?

    I have an Ext.List that I've put into an Ext.Panel as the only item. When I add another item to the panel (say, a selectfield) the list disappears. Here's some sample code of what I'm trying to do:

    Code:
        
    var listView = Ext.create('Ext.List',{        
            store: store,
            emptyText: 'No data to display',
            itemTpl:'{Name}',
            docked: 'top'
        });        
    
       var newPanel = Ext.create('Ext.Panel', {
        items: [listView,
             {
                        xtype: 'selectfield',
                        docked: 'bottom',
                        name : 'Name',
                        store: store,
                        valueField: 'Name',
                        displayField: 'Name'
                 }
             ],
        title: 'users',
        layout:'fit'
     });
    
    Ext.Viewport.add(newPanel);
    If I remove the selectfield from my items config above and just leave in the listView, things work fine. Can a list share a panel with other xtypes?

  2. This is because of your use of layout : 'fit'. Fit layout only supports one inner item.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    This is because of your use of layout : 'fit'. Fit layout only supports one inner item.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Feb 2011
    Posts
    28
    Vote Rating
    0
      0  

    Default

    Thanks again Mitchell.

    Just for my own education, is there a link on the Sencha site that discusses the layout configuration options, and what will and won't work with multiple components? I don't want to waste anyone's time with questions that I can find the answers to myself easily.

  5. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    The API docs do a pretty good job of explaining things as they have images that try to show you what is going on. There is also a guide: http://docs.sencha.com/touch/2-0/#!/guide/layouts
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

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
  •