How to implement Vertical layout
-
15-01-2021 - |
Question
Is there a way to implement vertical layout using Dojo/Dijit? I don't like BorderLayout
because of the splitters.
Solution
Unless you really need some particular feature (that you did not mention) from BorderLayout it might be possible to just use plain old HTML+CSS & DOM manipulation instead:
var d = dojo.create('div', {}, parentNode);
d.appendChild(aWidget.domNode);
d.appendChild(dojo.create('div', {innerHTML: 'a plain HTML node'}));
d.appendChild(anotherWidget.domNode);
//...
EDIT: I just came across a case where I actually wanted a VerticalLayout, due to some code operating on the addChild and removeChild functions. I managed to implement it by just mixing in some existing classes:
var VerticalLayout = dojo.declare([dijit._Widget, dijit._Container], {});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow