I'm using DOJO's ContentPane
module. I have a div
element in one of the panes and I need to give it a certain height - 100 pixels less than the height of the ContentPane
so that the div
changes its height dynamically when you change the ContentPane
size by dragging the splitters. I'm new to Dojo and would be happy if somebody could help me with this.
Thanks.
I think the best solution is via nested
BorderContainers
with properly setsplitters
, because that waydijit/layout
will take care of resizing and you won't need to write any JavaScript code and your layout will be based solely on CSS.It's kinda cumbersome to explain, so I created a working example for you at jsFiddle: http://jsfiddle.net/phusick/Ayg8F/ + a diagram:
NB: Do not forget to set
height: 100%
forhtml
,body
and the topBorderContainer
.The drawback of this solution is you will have to replace plain
divs
withContentPanes
. If you do not want to or can't you can usedojo/aspect
and connect toBorderContainer
orContentPane
resize
method and resize yourdivs
manually whenever the size changes: