PDA

View Full Version : Vbox / ListView



Bleak
27 Apr 2010, 4:11 AM
Good Morning,

I'm having some difficulty putting a ListView inside of a TabPanel that has a layout of VBOX and having the ListView stretch to fill the entire TabPanel container?

Is it possible to have a ListView widget inside of a TabPanel utilizing stretch? I ask, as most other objects (buttons, etc) do not seem to have any problem stretching.

Thank you,
Dean.

jay@moduscreate.com
27 Apr 2010, 10:22 AM
Yes it is possible.

jay@moduscreate.com
27 Apr 2010, 10:23 AM
what do you mean by "Tab panel container"? if you have one vbox inside of a tab, why not use the fit layout?

florian_cargoet
4 May 2010, 5:06 AM
I've the same issue :
A panel with a vbox layout (align : 'stretch') and 2 items (a listview & a panel).
The listview doesn't fill the width of its parent but it works if I use a panel instead.

A workaround could be to nest the listview in a panel (with fit layout) but since ListView is a BoxComponent, it should work and I don't like overnesting.

jay@moduscreate.com
4 May 2010, 5:14 AM
I've the same issue :
A panel with a vbox layout (align : 'stretch') and 2 items (a listview & a panel).
The listview doesn't fill the width of its parent but it works if I use a panel instead.

A workaround could be to nest the listview in a panel (with fit layout) but since ListView is a BoxComponent, it should work and I don't like overnesting.

I suggested something similar with DataView to the team over two years ago.

This is why I create a ListPanelBaseCls and ChartPanelBaseCls classes for my book.

http://app.extjsinaction.com/resources/js/TKE/listpanel/ListPanelBaseCls.js

http://app.extjsinaction.com/resources/js/TKE/chartpanel/ChartPanelBaseCls.js

florian_cargoet
4 May 2010, 5:22 AM
I found the guilty in ListView.js at line 195

"maxWidth: Ext.isIE ? 99 : 100,"and in VBoxLayout :

case 'stretch':
stretchWidth = availWidth - horizMargins;
calcs.width = stretchWidth.constrain(child.minWidth || 0, child.maxWidth || 1000000);
calcs.dirtySize = true;
break;Shouldn't the layout use boxMaxWidth/Height defined by BoxComponent ?

Thanks for the link, I think i'll go with a nesting panel.
EDIT : a nesting container is enough, there is no need for a full panel.