Dojo/Dijit - How to allow Vertical Scrolling on a layout control

NealWalters picture NealWalters · Dec 12, 2010 · Viewed 11.6k times · Source

How can I allow scrolling in this Dojo/Dijit page:

http://www.olexe.com/html/DijitScrollTest.html

I might have 60 or 100 rows to display in the tabControl (id="topTabs").

I think there must be a property such as AllowScrolling but I cannot find it. Or do I need to add a child control, and then turn on scrolling in the child control. (If you could also point me to the Dijit doc where it is document, that would be appreciated. I have been hunting for over one hour for it).

Answer

DanneManne picture DanneManne · Dec 13, 2010

In general scrolling is easily activated by setting the CSS style overflow to "auto". However, I have looked through your page a little and I have a few questions.

First, you add a TabContainer in the center region of the BorderContainer, but then you never add any tabs to that Container that I can see. TabContainers are usually populated with several ContentPanes to acts as different Tabs.

So if you want tabs, then I would add an additional child element in the form of a ContentPane that holds all the content, otherwise I would change the existing TabContainer into a ContentPane.

Either way, it is the ContentPane that should have the overflow: auto; attribute set to allow scrolling within that element.