Dijit Overview

Dijit is Dojo’s UI Library, and lives as a separate namespace dijit. Dijit requires Dojo Core and Dojo Base.

Each of the widgets and functionality provided by Dijit are described in the following sections, though the Getting Started guides and the Tutorials cover some basics.

Utility Classes

Utility methods and classes used by widgets or by applications with widgets.

  • dijit.a11y - functions about tab index
  • dijit.focus - keeps track of focused node and active widgets
  • dijit.place - low level code for positioning popups / drop downs
  • dijit.popup - high level library routines for positioning popups / drop downs
  • dijit.registry - registry of all widgets on the page
  • dijit.typematic - for normalizing key-repeat across browsers, plus simulation “mouse-repeat”
  • dijit.Destroyable - for tracking handles and releasing them when an object is destroyed

Form Widgets and Handling

Note about programmatic instantiation

For most of the Dijit widgets, you can provide a refNode which is a placeholder to position your node. Beware that any attribute set on it (form action, input value, etc.) won’t be taken into account. If you want to degrade nicely and have a non-JS compatible version of your site and avoid duplicating attributes on controls and on instantiation, you should use parser.instantiate():

require(["dojo/parser", "dojo/dom", "dijit/form/ValidationTextBox"], function(parser, dom, ValidationTextBox){
  var myNode = dom.byId("myNode");
  // All attributes of myNode will be preserved in the widget
  parser.instantiate([ myNode ], {
    data-dojo-type: "dijit.form.ValidationTextBox",
    dojoSpecificAttr1: value,
    dojoSpecificAttr2: value
  });
});
Error in the documentation? Can’t find what you are looking for? Let us know!