It helps in Scripting and event management. It provides abstraction layer to the programmer to develop powerful features very easily. Dojo base size is very small (26 KB) which take less bandwidth and less initial load time (based on required feature).
Download the Latest released version of Dojo Toolkit from http://dojotoolkit.org/download/
After downloading, extract the contents of archive folder. In that folder you get three folders Dojo, Dijit, Dojox. Put these three folders in your Web project’s folder.
Folder Structure of Dojo Toolkit –
1 – Dojo – This is the core API of this framework and contains all that is required initially(like classes declaration, event listening ,asynchronous request etc.)
2 – Dijit – Dijit constitutes developing and reusing interface components built on top of dojo core. If you can write HTML and CSS Manualy, Dijit allows you to quickly build reusable client side components. It contains js files for reusable components.
3 – Dojox – This could be considered as dojo plugins meant for testing of new features that will be the part of Dojo or Dijit namespace in future.
Benefits of Dojo Framework
Dojo toolkit provides many widgets to develop the UI for web applications. Dojo is one of the robust ajax framework that can be used to develop enterprise applications.
Dojo toolkit has features like Associative arrays, Highly evolved date, math, and string libraries and W3C DOM support.
Developers have to check whether their browser supports Dojo and there is no way to hide the Dojo code.
How to Use dojo Widgets
Example of a Simple Dojo Application:
In this application we use Number Textbox which is very advance Textbox And also see some its functionalities.
First you Download Dojo Toolkit from: http://dojotoolkit.org/download/
Extract it in the Content folder of the dynamic web project.
In the Content folder create a new HTML page.
-In the Head section put this content
<head id=”Head1″ runat=”server”>
<title> First Application </title>
<script djconfig=”parseOnLoad: true” src=”dojo-release-1.8.1/dojo/dojo.js”
Head section Code:
– We are using tundra.css and have imported core Dojo library from dojo.js.
In this Application, we set the parseOnLoad property to true using djConfig attribute, because if we don’t set it to true there will be no widget creation.
–In the Body section put this content
<form id=”form1″ runat=”server”>
<h1> NumberTextBox Application Demo </h1>
<label id=”lblNumberTextBox “> NumberTextBox </label>
<input id=”NumTxtBox” dojotype=”dijit.form.NumberTextBox”/>
In the body section:
We set tundra class in the body tag. All form widgets are added using the <input> or <select> tag and the dojoType attribute.
When you will run this Application following page will be displayed.
When we enter value like 12345678 then it shows like this.
And when we enter decimal value like .12389 then this control converts it into round figure
And when we give wrong input it will give an error as follows:-
Dojo has good tutorials and blogs that help developers to understand the Dojo framework.
Uselfull link: http://dojotoolkit.org/api/