javascript - Resizing inner div on resizing size of dijit.layout.BorderContainer -
i have div of dojotype dijit.layout.bordercontainer, , trying set size of bordercontainer dynamically respect size of viewport. html code create border container
<div dojotype="dijit.layout.bordercontainer" design="sidebar" gutters="true" livesplitters="true" id="bordercontainer" style="border: solid green 3px;"> <div dojotype="dijit.layout.contentpane" splitter="true" region="leading" style="width: 230px; padding:2px 0px 0px 0px;"> </div> </div>
i updating size of border container using following javascript code
var viewport = dojo.window.getbox(dojo.doc); dojo.setstyle('bordercontainer','height','430px');
but on executing code able see size of div of type border container changed, div inside div of type bordercontainer not changing.
you need call resize
on widget , widget resize children.
var viewport = dojo.window.getbox(dojo.doc); var bordercontainer = dijit.byid('bordercontainer'); dojo.setstyle(bordercontainer.domnode, 'height','430px'); bordercontainer.resize();
an alternative approach
when want border container take whole screen, set it's height
, width
100%. parent dom nodes of border container need height of 100% set (i.e. <html>
, <body>
, etc.)
Comments
Post a Comment