I have a sidepanel (query form), a center panel (a map), and a bottom panel that has a height of 2%. When a query is done on the side panel, I'd like the bottom panel to show up (height = 30%) with the results.
I am using the BorderContainers.
I can get the bottom panel to change size, but you have to touch the bottom panel and resize in order for the tabcontainer (holding the results) to expand. Otherwise, its an empty panel with just the tippy top of the tabs showing (from the height = 2%).
<div id="bottompanel" data-dojo-type="dijit/layout/TabContainer"
data-dojo-props="splitter: true, region:'bottom'" style=" height: 2%; ">
<div data-dojo-type="dijit/layout/ContentPane" title="tab #1">tab pane #1</div>
<div data-dojo-type="dijit/layout/ContentPane" title="tab #2">tab pane #2</div>
<div data-dojo-type="dijit/layout/ContentPane" title="tab #3">tab pane #3</div>
</div>
function openResults() {
toggleResults(bottompanel);
}
function toggleResults(contentElement) {
require(["dojo/dom-geometry", "dojo/dom", "dojo/dom-style"],
function (domGeom, dom, domStyle) {
var node = dom.byId(contentElement);
var computedStyle = domStyle.getComputedStyle(node);
var size = domGeom.getMarginBox(node);
if (size.h > 20) {
domStyle.set(dom.byId("bottompanel"), "display", "none");
domStyle.set(dom.byId("centerpanel"), "height", "100%");
} else {
domStyle.set(dom.byId("bottompanel"), "display", "block");
domStyle.set(dom.byId("bottompanel"), "height", "30%");
domStyle.set(dom.byId("centerpanel"), "height", "70%");
}
});
}
I don't know how to make it refresh or resize.