Book Image

Learning Dojo

By : Peter Svensson
Book Image

Learning Dojo

By: Peter Svensson

Overview of this book

<p>Dojo is a popular AJAX-specific open-source JavaScript framework for building powerful web applications. It provides a well conceived API and set of tools to assist you and fix the issues experienced in everyday web development. Your project size is no concern while using Dojo. It is the best scalable solution to all your size-related issues.<br /> <br />This book starts by giving you tips and tricks for programming with JavaScript. These tricks will help you with Dojo. With every chapter, you will learn advanced JavaScript techniques. You will learn to leverage Dojo for a clean web application architecture using JSON or XML.</p>
Table of Contents (13 chapters)
Learning Dojo
Credits
About the Author
About the Reviewer
Preface
Free Chapter
1
Introduction to Dojo

Dijit structure


The most basic definition of a Dijit is that it is a Dojo class which is associated with a certain DOM element in a web page. It is, in any other aspects, a regular Dojo class. The _Widget base class (that is the ultimate root class of all Dijits) does add a number of extra handle properties and functions to all Dijits, such as the variable domNode which refers to the DOM node which the Dijit is associated with.

All Dijits also have a lifecycle (described below) where Dojo ensures that certain functions on the Dijit are called at various times. There is for example one function that will be called before the Dijit is actually displayed and another one, which is called before any child Dijits are created, and so on.

Lifecycle

Regardless of whether a widget gets instantiated by the parser searching the page (or parts of it) for widgets to create, or by you creating it programmatically, certain functions get called at certain times.

In the base widget class dijit._Widget, we see...