Chapter 14. Layout Widgets
Unfortunately, many web apps consume nontrivial amounts of time implementing and rediscovering CSS shenanigans to achieve layouts that have been realized many times already and that should be a lot easier than they often turn out to be. This chapter introduces the layout dijits, a number of useful containers for creating common layouts in markup. Layout containers allow you to automate incredibly common tasks such as producing a tabbed layout as well as producing arbitrary tiled layouts without resorting to custom CSS for floating content, calculating relative offsets, etc. Unlike the previous chapter on form widgets, this chapter is shorter, much simpler, and more predictable. There are only a handful of layout widgets; all of them have only a few configuration options and very few caveats.
Layout Dijit Commonalities
All layout dijits exist within the dijit.layout namespace and share a small set
of baseline features that you should be aware of. In addition to
inheriting from _Widget, _Container, and _Contained, they share a few extra
commonalities. This section quickly reviews the commonalities, listed
in Table 14-1, which are all
pretty easy to get your head around.
Table 14-1. Layout dijit common methods
Name | Comment |
|---|---|
| Returns whether the widget is a layout container. |
| Overridden by widgets
to size and position their contents (child widgets). This is
called after |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access