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 the quickstart guides and the Tutorials cover some basics.

Utility Classes

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

  • dijit.focus - keeps track of focused node and active widgets
  • dijit.hccss - for detecting when IE or FF is in high contrast (aka no background images) mode
  • 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”

Tree Widgets

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!