-
23 Dec 2012 11:02 PM #1
Answered: How to show content in layout after click tree node
Answered: How to show content in layout after click tree node
Hello everybody,
i am stuck here.
i have a tree like this
MyTree.js
the tree is in region 'west', so when i click the node tree, i want to display tab panel in the center.Code:var store = Ext.create('Ext.data.TreeStore', { proxy: { type: 'ajax', url: 'application/controllers/itemlist.php', node: 'id' }, root: { text: 'Root Node', id: 'root_node', expanded: true } }); var treePanel = Ext.create('Ext.tree.Panel', { id: 'tree-panel', region:'north', autoHeight: true, minSize: 150, rootVisible: false, border: false, flex: 3, store: store }); var detail = Ext.create('Ext.panel.Panel', { title: 'Details', region: 'south', height: 240, border: false, bodyStyle: 'padding: 5px;', autoScroll: true, flex: 1, html: '<p style="margin: 5px;">When you select a layout from the tree, additional details will display here.</p>' }); Ext.define('AM.view.layout.MyTree', { extend: 'Ext.container.Container', alias: 'widget.mytreepanel', layout: { type: 'vbox', align: 'stretch' }, items: [ treePanel, detail ] });
for code in the tab panel is
MyContent.js
how do i make it happen?Code:Ext.define('AM.view.layout.MyContent', { extend: 'Ext.panel.Panel', alias: 'widget.contentpanel', activeItem: 0, layout: { type: 'card', deferredRender: true }, border: false, region: 'center' });
-
Best Answer Posted by mitchellsimoens
I see you are using the region config but then using vbox layout. The region config will only work for border layout. You can add/remove items to a center region of a border layout.
-
26 Dec 2012 11:23 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
- Answers
- 3111
I see you are using the region config but then using vbox layout. The region config will only work for border layout. You can add/remove items to a center region of a border layout.
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.
-
28 Dec 2012 10:29 AM #3
thank you a lot, Mitchell. finally fix this problem.



Reply With Quote