how to get SplitPanel to auto-follow Table height?

Hi,

Say I have a master-detail view with a SplitPanel, where there’s a Table at the top (first component), and a Form at the bottom (second component).

Is there a way to have SplitPanel’s splitPos to automatically set to the required height of the Table? eg. have it always split at the height required to display 3 rows, without knowing what that height is before hand?

I’ve tried the following, but they don’t behave how I want:

  • not setting split pos: the vertical space is shared evenly between the top and bottom pane, which means too much space is given to the table

  • setting the split pos % without specifying a unit: requires trial and error, and % is only correct for the window size I’m testing in (ie. % becomes incorrect as soon as I resize the browser window)

  • setting the split pos in pixels: requires trial and error, and needs manual (ie. code) change if I change the row height

Any suggestions?

Hi,

Unfortunately I don’t think that it is possible to do what you want without modifying or creating your own VSplitPanel implementation. The current implementation just wasn’t designed to allow such a thing.

Do you actually need a SplitPanel if you always want it to take a certain amount of space? I think that I would just build a custom component with the table on top and the view below it and perhaps an image or some other kind of separator inbetween.

HTH,
/Jonatan