Dijit Layout: How to display ContentPanes inline?
-
14-07-2021 - |
Question
In the following HTML, I want to display the two ContentPanes in the top region beside each other. In normal HTML this could be done using spans, or display: inline. How can this be achieved in Dijit?
<div>
<div data-dojo-attach-point="_containerNode" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="gutters: false, design: 'headline'">
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top'">
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top'">
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center'">
</div>
</div>
Solution
Wrap the two divs in another BorderContainer like:
<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="gutters: false, design: 'headline'">
<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="region: 'top', gutters: false">
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'left'"> </div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'right'"> </div>
</div>
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'center> </div>
</div>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow