PDA

View Full Version : Several items in one tab



Tascha
10 Aug 2009, 11:32 PM
Hello,

I have a question. I want to put more then one item in a tab. That means: One FormPanel and one grid. So what I have to do?

Now:




var TabPanel = new Ext.TabPanel({
region: 'center',
activeTab:0,
layoutOnTabChange: true,
items:[{

title: 'Startseite',
closable:false,
autoScroll:true


},{

title: 'Geräte',
layout:'fit',
closable:true,

items: [

simple = new Ext.FormPanel({ //Here the first item

labelWidth: 75,
url:'database.php',
frame:true,
title: 'Allgemeine Daten',
bodyStyle:'padding:5px 5px 0',
width: 100,
defaults: {width: 230},
defaultType: 'label',
items: [{
fieldLabel: '10',
name: 'first',
allowBlank:false
},{
fieldLabel: '12',
name: 'last'
},{
fieldLabel: '13',
name: 'company'
}]


})




],
items: [aktuell_ListingEditorGrid] //Here the second item



}],



listeners: {

tabchange: function(newLoad){
newLoad.doLayout();
}
}
});

But in this code, the grid covers the FormPanel.
What can I do?

Greetings

Tascha :)

Tascha
11 Aug 2009, 12:29 AM
Oh I'm sorry, it works already, but the grid doesn't render ordinary. So, that are perhaps some option I have to change.

Greetings

Tascha :)

Animal
11 Aug 2009, 12:38 AM
Layouts.

When you say "in" something, that means you are using it as a Container.

Child Components in a Container are rendered and arranged by the Container's layout

Read about Container: http://extjs.com/deploy/dev/docs/?class=Ext.Container

Choose how you would like to have the two layed out, and pick an approriate layout which does what you want.

Tascha
11 Aug 2009, 3:11 AM
Thanks Animal,
now it works fine!

Animal
11 Aug 2009, 3:15 AM
What was your eventual solution?

Probably needs some checking.