PDA

View Full Version : Layout Question: Having trouble with nested items, starting to think not possible



Tumac
22 Sep 2010, 9:39 AM
Can this layout be done?



Cardpanel
+CardIPaneltem
- Tabpanel
+TabPanelItem
-BorderLayout


I can get the Cardpanel and the tabpanels to render, but when I go to add the layouts for the tab panels, my application blows up. If this type of layout is OK, I think I have either a namespace issue or something else.

Does that make sense even?

22 Sep 2010, 10:04 AM
Yes it's entirely possible.

What is a "CardPanel"?

Tumac
22 Sep 2010, 10:29 AM
Jay - this is taking the cardpanel layout from your book's Ch16 application and when you click the cardpanel item, instead of going to the "Manager" with a border layout, inserting another layer under the card layout that has a bunch of tabpanels and under each of those tabpanels, the "manager" exists. Does that make sense?


pseudo code



Ext.Panel
layout: 'card'
items:
[
{xtype: panel1} // Ext.reg('panel1,MyApp.Panel1)
,{xtype: panel2} //Ext.reg('panel12,MyApp.Panel2)
]
----------------
MyApp.Panel1=Ext.extend(Ext.Panel, {

layout: 'fit' //Not sure here as I want to have a bunch of tabs
items: [{
xtype:'tabpanel'
items: [{
xtype: 'appform1' //Ext.reg('appform1',MyApp.AppForm1
},{
xtype: 'appform2'
}]
----------------------------
MyApp.AppForm1=Ext.extend(Ext.Panel, {
layout : 'border'
items : [{
xtype: mygrid
},{
xtype: myform
}]

22 Sep 2010, 10:33 AM
I thought it sounded familiar :).

The TabPanel can be a direct child of any container using the card layout (or CardPanel as a custom class).

You don't add layouts to a container, you add child items. Layouts are leveraged by the container to visually organize children on screen (see the layouts chapter for a refresher).

Tumac
22 Sep 2010, 11:19 AM
OK - I was getting tabs to display under the cardpanel item I assigned them to, but was not getting stuff to display under the tabpanels. I moved this part of my application to a standalone application in the meantime. Perhaps I had a namespace issue as I created a new folder for these scripts and forgot to change the namespace?

22 Sep 2010, 11:27 AM
possibly :( hard to tell.