Dijit for Designers
The fundamentals for using an existing dijit in markup are quite
simple: a dojoType tag specifies
the type of dijit that should be placed in the page, attributes pass
data into the widget upon creation, and extension
points allow you to override existing widget behavior.
While the dojoType tag is required,
attributes usually are set to reasonable default values, and extension
points always fall back to a reasonable implementation.
Tip
The difference between "methods" and "extension points" is
purely a semantic one: methods are operations
that the application programmer call directly to control a dijit.
Extension points are methods that the
application programmer does not call directly; the dijits calls them
itself when an appropriate condition arises. For example, a widget
might have an explicit method like setValue that could be called to
programmatically adjust it, while a method like onKeyUp would be an extension point in
that it gets called automatically each time a key is pressed.
There are several attributes, listed in Table 11-2, that are especially important to be aware of for out-of-the-box usage because these attributes are set directly on a widget's DOM Node. These attributes ultimately ensure that the dijit's underlying HTML markup is as customizable and "proper" as possible.
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