PDA

View Full Version : hbox with dynamic-size-panels



mes-x
8 Feb 2011, 1:52 AM
Hi,

i got into some troubles with the hbox layout or the column layout in ExtJS 3.3.
I need a layout to display some panels in a horizontal way like this:


# = parent Panel
Parent Panel width: 1500px
#################################
#+----+----+----+----+---------+#
#|pan1|pan2|pan3|pan4|panel 5 |#
#| | | | | |#
#|200 |200 |200 |200 | ???? |#
#| px | px | px | px | px |#
#| | | | | |#
#| | | | | flex: 1 |#
#| | | | | |#
#+----+----+----+----+---------+#
#################################
but i need the panels to collapse and to expand (if panel 2 collapses, panel 3 and 4 should move to the left).
All the panels should fit the height of the parent panel and have a fixed with, exept one panel with a dynamic with (fit the rest of the empty space (like flex: 1 in the hbox))

The problem is now, that the hbox layout does not support expanding and collapsing, and the column layout does not support using the maximum possible height and (for one panel) use the maximum remaining width (and when i collapse a panel, it collapses to the top and not to the left).

Do u have any recommendations what i could do? I can't believe this is some exotic thing, isn't it?


thank your very much and best regards!
Manuel

Sesshomurai
8 Feb 2011, 6:20 AM
This will require a custom layout manager, but it would be a useful one.

I have a similar problem with hbox with scrolling and I also want resizable panels. I tried wrapping them in Resizable but hbox couldn't handle it.

A missing, but common layout, would be a FlowLayout that does react to component resizes.

mes-x
9 Feb 2011, 6:24 AM
No solution for this (more or less) basic feature???

regards
Manuel

Sesshomurai
9 Feb 2011, 7:07 AM
This basic feature doesn't seem possible out-of-the-box and so a new layout manager would need to be written. I agree it should already exist or perhaps there's a clever way to achieve it with the current layouts, but I haven't figured that out.