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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -