PDA

View Full Version : Grid in TabPanel: how to set height?



Ex_Soft
6 Nov 2010, 4:52 AM
var
grid = new Ext.grid.EditorGridPanel({
store: store1,
clicksToEdit: 1,
colModel: colModel,
autoExpandColumn: "ColField1"
}),
tp = new Ext.TabPanel({
region: "center",
activeTab: 0,
items: [{
title: "Grid# 1",
items: [grid]
}, {
title: "Grid# 2",
html: "html"
}]
}),
viewport = new Ext.Viewport({
layout: "border",
renderTo: Ext.getBody(),
items: [tp]
});
But grid doesn't fill all space of Tab.

Animal
6 Nov 2010, 2:57 PM
I can't face it again. Sorry.

Why? Why do you do it?

Ex_Soft
9 Nov 2010, 12:09 PM
var
grid = new Ext.grid.EditorGridPanel({
==> region: "center",
store: store1,
clicksToEdit: 1,
colModel: colModel,
autoExpandColumn: "ColField1"
}),
tp = new Ext.TabPanel({
region: "center",
activeTab: 0,
items: [{
==> layout: "border",
title: "Grid# 1",
items: [grid]
}, {
title: "Grid# 2",
html: "html"
}]
}),
viewport = new Ext.Viewport({
layout: "border",
renderTo: Ext.getBody(),
items: [tp]
});

Ex_Soft
10 Nov 2010, 2:48 AM
Why? Why do you do it?
Where am I wrong?

Animal
10 Nov 2010, 2:51 AM
http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container

And from just a few lines into that EXTREMELY important class which you have to know because you use it all the time....

http://i131.photobucket.com/albums/p286/TimeTrialAnimal/containerdocs-grid-as-tab.jpg?1289386567

Note it says grid as tab.

Condor
10 Nov 2010, 4:02 AM
To be completely clear:
Do not overnest! There is no reason to use a panel to contain a gridpanel.

var grid = new Ext.grid.EditorGridPanel({
title: "Grid# 1",
store: store1,
clicksToEdit: 1,
colModel: colModel,
autoExpandColumn: "ColField1"
}),
tp = new Ext.TabPanel({
//region: "center",
activeTab: 0,
items: [//{
//items: [grid]
//},
grid,
{
title: "Grid# 2",
html: "html"
}]
}),
viewport = new Ext.Viewport({
layout: "fit", //"border",
//renderTo: Ext.getBody(),
items: [tp]
});

Ex_Soft
10 Nov 2010, 11:27 PM
There is no reason to use a panel to contain a gridpanel.
Code:

Many thanks