1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    28
    Vote Rating
    0
    Larry Q is on a distinguished road

      0  

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

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,206
    Answers
    3516
    Vote Rating
    856
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This is because of your use of layout : 'fit'. Fit layout only supports one inner item.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    Larry Q is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,206
    Answers
    3516
    Vote Rating
    856
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

Thread Participants: 1

Tags for this Thread