-
3 Apr 2012 3:38 PM #1
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:
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?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);
-
Best Answer Posted by mitchellsimoens
This is because of your use of layout : 'fit'. Fit layout only supports one inner item.
-
4 Apr 2012 5:01 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
- Answers
- 3113
This is because of your use of layout : 'fit'. Fit layout only supports one inner item.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Apr 2012 7:24 AM #3
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.
-
4 Apr 2012 7:32 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
- Answers
- 3113
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote