PDA

View Full Version : treepanel autoheight?



dcoan604
3 Mar 2012, 3:56 PM
In my WEST panel of border layout, I would like the following items:

1. Treepanel (used as navigation menu)
2. Panel (with an image)
3. Possible more panels

How do I get the treepanel to resize itself when nodes are opened and closed?
In other words, if I expand a node, items #2 and #3 above should move "down" within my west panel to accomodate the now larger tree

Same thing in reverse

I've tried setting my west panel layout to vbox and also played with anchor...but couldn't get it to work.
Also used autoHeight on the treepanel.. to no avail.

skirtle
3 Mar 2012, 4:59 PM
I believe this is very tricky. It's also usually bad UI design.

I got a partial solution working against an early version of 4.0, it may still work:

http://www.sencha.com/forum/showthread.php?146090

It worked well in certain cases but it relied on CSS so in cases where it doesn't work it really doesn't work.

I'm not sure what layout would work best for getting this to play nice with those other components. You'd have to experiment. You may also have to extend the auto-height CSS to wrapper elements if you use a layout that requires them.

dcoan604
4 Mar 2012, 12:44 PM
Thanks for the reply.

I've decided against doing it, since it isn't something ext handles automatically.

Can u elaborate on why this might be bad design choice?

I can see it being bad if your tree store has too many items I guess. In my case the menu would be fairly limited in size, and I'm only allowing one node to be expanded at one time.

I successfully used a similar approach elsewhere, with grids. I have a panel which contains three grids, each having 0-10 records. The panel is set to autoscroll...and each grid is set to autoheight (with no scroll bars). It works well in my case. I'm using it to display associated data (tel numbers, email addresses and addresses) related to a Contact model. I can view all the info for a contact by scrolling the main panel. One scroll bar instead of three.