PDA

View Full Version : vbox for a new added tab into TabPanel



calavera
19 Sep 2009, 5:15 PM
Hello. I'm using ExtJS 3. I have a viewport with a tabpanel as item for the center panel. With a click of one button, a function adds a new tab with a Grid as its item like this:



center.add({
title: 'Books',
items: [Books.Grid1],
closable:false
}).show();


How can I add the new tab with the grid stretched in it ? I want to show the grid with auto width and height based on the center region size. So if I resize the browser, the grid should resize too in order to stretch on the new panel size. I have read about the vbox layout but I don't know how to configure it on my viewport-tabpanel-grid config.

Any ideas ? Thank you.

Animal
19 Sep 2009, 11:44 PM
WHY choose to WRAP the grid? Please answer.



center.setActiveTab(center.add(Books1.Grid1));

calavera
21 Sep 2009, 4:04 AM
Dunno, it's the way it came out. Is it that wrong ?

Animal
21 Sep 2009, 4:37 AM
Why would you do it?

At what point do you CHOOSE to stop wrapping something?

You could have added



{
items: {
items: {
items: {
items: {
items: Books1.Grid
}
}
}
}
}


But you CHOSE 1 layer of wrapping instead of zero or 5.

aconran
21 Sep 2009, 5:01 AM
Let's aim for zero wrapping ;)



center.add(Books.Grid1);


Any additional configuration you wanted to apply like closable false (which is already default) could go into the configuration when you instantiated Grid1.

calavera
21 Sep 2009, 2:09 PM
Ok, understood. I got my problem figured out.

Thank you for your answers.