SlideShare a Scribd company logo
Dojo Tutorial




            Girish Srivastava
Objective
 In this tutorial, we will learn everything about the dojo. After completing the
  tutorial you will be able to understand about Dojo framework.
 This Dojo tutorial covers:
           Introduction to DOJO
           Features of Dojo
           Why DOJO tool kit?
           DOJO tool kit Libraries
           Comparison between different tool kits
Introduction to Dojo
 What is Dojo?
  Dojo is JavaScript framework released as open
   source software. This JavaScript toolkit provides
   many components to develop rich internet
   applications.
  You can use Dojo toolkit to develop dynamic web
   applications. Dojo toolkit will put life in your web
   application and turn it into highly interactive
   application. You can turn your web application into
   desktop like web application.
  Dojo offers many widgets, utilities and ajax libraries
   to develop your application.
  Dojo is released under BSD or AFL license
Dojo tutorial
Features of Dojo
 Dojo is based on HTML and JavaScript, so its easy for the
    developers to learn it fast.
   There is no requirement of learning new programming language.
    Just HTML and JavaScript knowledge if sufficient.
   Dojo provides higher abstraction layer to the programmer. So, it
    helps the programmers to develop powerful functions very easily.
   Dojo has already invented the wheels for the programmers and
    now programmers just have to use the Dojo api into their
    application
   Here is the list of components that comes along with Dojo
    framework:
   DOJO Tree
   DOJO Button
   DOJO Calendar control
   DOJO Grid
   DOJO List box
   and many more..
Dojo tutorial
Dojo tutorial
Dojo tutorial
DOJO Core
What Is Dijit?
Dojo tutorial
Dojo tutorial
Dojo tutorial
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 grade application.
 Following are the benefits of Dojo.
      Associative arrays
      Loosely typed variables
      Regular expressions
      Objects and classes
      Highly evolved date, math, and string libraries
      W3C DOM support in the Dojo
Disadvantages of Dojo
 Developer depends on the browser support for
  the Dojo
 There is no way to hide the Dojo code in case of
  commercial application
Dojo tutorial
JQuery versus Dojo versus YUI
               • JQuery
 Pros:
  - JQuery is the most popular one of them all.
  - It is very easy to use and to understand.
  - The core library is only 15Kb in size.
  - Their statement is: ‘The Write Less, Do More,
  Javascript Library’.
 Cons:
  - Hard to use with object oriented programming
  - JQuery supports plug-ins, but all these plug-ins are
  not verified.
  - JQuery is a library
•YUI(The Yahoo! User Interface
                 Library)
 Pros:
  - It is developed by Yahoo
  - Fully documented, with a great API browser
  - Very consistent and reliable
  - Also contains unit testing framework
  - YUI is a framework
 Cons:
  - Heavy page weight
  - Very few utility or helper functions/methods
  - Lacks the use of chaining methods together
• Dojo Toolkit
  Pros:
   - Debug your code in Firebug
   - Dojo integrated in Zend Framework
   - Hierarchical package system speeds loading
   - Dojo is a framework
  Cons:
   - Dojo fails in online documentation


When we compare these 3 libraries/frameworks, I found
the following which was quite useful.
http://selectors.turnwheel.com/slickspeed.php
 Based on these results, we can conclude that YUI is the
    slowest one. This is also the reason why we didn’t chose for
    YUI. Dojo and JQuery scores the best.
   Knowing that JQuery is the easiest to use and immense
    popular, Dojo has its advantage of being integrated in Zend
    Framework. Also, the difference in being a library or
    framework counts.
    - A library is about reusable functionalities, but a framework is
    about reusable behaviours
    - A library is something you call/inherit from your code, but
    framework is something that calls your code or provide
    services for your code
    - A library is a collection of components and classes, where
    framework is how abstract classes and components interact
    with each others
   Dojo is a framework and JQuery a library.
    JQuery is good for small websites where you want to achieve
    a ‘WOW’ factor in relative short time.
   But when you are building an application, you need a robust
Dojo tutorial
Dojo tutorial
Dojo tutorial
Dojo tutorial
Loading Dojo ToolKit
Dojo tutorial
Install Dojo
 Downloading Dojo
  You can download the latest version of Dojo from its official
   site http://dojotoolkit.org/.
  Download the Dojo toolkit directly
   from http://dojotoolkit.org/download.
Dojo tutorial
Dojo tutorial
Remoting
(Ajax Application)
Dojo tutorial
Dojo Hello World
<html>                                       dojo.addOnLoad(init);
<head>                                        </script>
                                             </head>
<title>button</title>
                                             <body bgcolor="#FFFFCC">
 <script type="text/javascript">             <p align="center"><font size="6"
 dojo.require("dojo.event.*");
 dojo.require("dojo.widget.*");              color="#800000">Welcome to Dojo
                                             Project</font></p>
 dojo.require("dojo.widget.Button");         <button dojoType="Button"
 function helloPressed()                     widgetId="helloButton"
 {
                                             onClick="helloPressed();">Hello
 alert('Click on the Hello World Button');
                                             World!</button>
 }                                           <br>
 function init()                             </body>
 {                                           </html>
 var helloButton = dojo.widget.byId('helloButton');
 dojo.event.connect(helloButton, 'onClick', 'helloPressed')
 }
 The above example we have created a button "Hello
  World!". To create a button in dojo you need to a Button
  Widget that contains three visual states as: mouseOut,
  mouseOver and mouseDown. To follow the following
  steps for creating a dojo button widget:
 <script type="text/javascript">
   // Load Dojo's code relating to widget managing
  functions
   dojo.require("dojo.widget.*");

  // Load Dojo's code relating to the Button widget
  dojo.require("dojo.widget.Button");
 </script>

 dojo.require("dojo.widget.*"): It instructs you to
 include the dojo widget (Not load all the widgets) for
 dojo.require("dojo.widget.Button"): This line instructs
  you to load the Dojo button widget. If you don't include
  this line, the markup code for the button would not be
  evaluated by Dojo upon loading, resulting in a plain
  HTML button instead of what you expect.
 Insert the following code into the HTML body:
 <button dojoType="Button" widgetId="helloButton"
   onClick="helloPressed();">Hello World!</button>
 The key attribute of this HTML element to notice is
  the dojoType attribute. This is responsible for instructing
  Dojo on how to process the element when the page is
  loading. In this case you will use abutton element for the
  button that is used to input element - Dojo will work with
  either as long as thedojoType attribute is present.
 widgetId="helloButton": This is replaced
    with id="helloButton" without the functionality
    being affected - Dojo's widget system is smart
    enough to convert regular idattributes to widgetId's
    if no widgetId` attribute is explicitly named.
   Connecting an Event to the Widget
   When you click the command button then it doing
    something? We specify an onClick event handler for
    the given command button.
   dojo.require("dojo.event.*");
   Above code we use "dojo.event.*" that includes all
    events functionality of Dojo
   Like This we can create can create different different
    examples.
   CheckBox …
   ComboBox…
Dojo tutorial
Dojo tutorial

More Related Content

What's hot (20)

PPTX
REST API
Tofazzal Ahmed
 
PPTX
ReactJS presentation.pptx
DivyanshGupta922023
 
PPTX
Flutter Intro
Vladimir Parfenov
 
PPTX
Object Oriented Programming In JavaScript
Forziatech
 
PPT
React js
Jai Santhosh
 
PPTX
Introduction to JSON & AJAX
Collaboration Technologies
 
PPTX
Jsp Introduction Tutorial
APSMIND TECHNOLOGY PVT LTD.
 
PDF
入社1年目のプログラミング初心者がSpringを学ぶための手引き
土岐 孝平
 
PPTX
Spring Boot Tutorial
Naphachara Rattanawilai
 
PDF
Reasons to use React Query
javaria javaid
 
PDF
Understanding react hooks
Samundra khatri
 
PDF
Tutorial de-como-instalar-un-editor-de-vídeo
kasandra980
 
PDF
The MEAN Stack
Md. Ziaul Haq
 
PPTX
Angular tutorial
Rohit Gupta
 
PDF
Introduction to Spring's Dependency Injection
Richard Paul
 
PPT
Ppt of soap ui
pkslide28
 
PPTX
Joget Workflow v6 Training Slides - 17 - Building Plugins
Joget Workflow
 
PDF
Introduction to React Native
Sambhu Lakshmanan
 
PDF
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
PPTX
React hooks
Ramy ElBasyouni
 
REST API
Tofazzal Ahmed
 
ReactJS presentation.pptx
DivyanshGupta922023
 
Flutter Intro
Vladimir Parfenov
 
Object Oriented Programming In JavaScript
Forziatech
 
React js
Jai Santhosh
 
Introduction to JSON & AJAX
Collaboration Technologies
 
Jsp Introduction Tutorial
APSMIND TECHNOLOGY PVT LTD.
 
入社1年目のプログラミング初心者がSpringを学ぶための手引き
土岐 孝平
 
Spring Boot Tutorial
Naphachara Rattanawilai
 
Reasons to use React Query
javaria javaid
 
Understanding react hooks
Samundra khatri
 
Tutorial de-como-instalar-un-editor-de-vídeo
kasandra980
 
The MEAN Stack
Md. Ziaul Haq
 
Angular tutorial
Rohit Gupta
 
Introduction to Spring's Dependency Injection
Richard Paul
 
Ppt of soap ui
pkslide28
 
Joget Workflow v6 Training Slides - 17 - Building Plugins
Joget Workflow
 
Introduction to React Native
Sambhu Lakshmanan
 
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
React hooks
Ramy ElBasyouni
 

Viewers also liked (16)

PPTX
How dojo works
Amit Tyagi
 
PPTX
Angularjs vs Dojo toolkit | SuperSpeaker@CodeCamp Iasi 2014
Endava
 
PDF
Dojo toolkit
Vanessa Me Tonini
 
PPT
Introduction To Dojo
yoavrubin
 
PPT
The Dojo Toolkit An Introduction
Jeff Fox
 
PDF
Advanced guide to develop ajax applications using dojo
Fu Cheng
 
ODP
Dojo
paola ortenzi
 
PDF
Rich internet application development using the dojo toolkit
alexklaeser
 
KEY
Dojo & HTML5
Mike Wilcox
 
PDF
Building Real-World Dojo Web Applications
Andrew Ferrier
 
PPTX
Refactoring legacy code: step-by-step examples
Endava
 
PDF
Ria with dojo
Tom Mahieu
 
PPTX
Practical training general for career services
Vickey Edge
 
PDF
DIGITAL EVOLUTION: A SUSTAINABLE APPROACH TO DIGITAL BUSINESS GROWTH
Endava
 
PPTX
Class Dojo
Laura Antichi
 
PPT
Introduction to HTML
Amit Tyagi
 
How dojo works
Amit Tyagi
 
Angularjs vs Dojo toolkit | SuperSpeaker@CodeCamp Iasi 2014
Endava
 
Dojo toolkit
Vanessa Me Tonini
 
Introduction To Dojo
yoavrubin
 
The Dojo Toolkit An Introduction
Jeff Fox
 
Advanced guide to develop ajax applications using dojo
Fu Cheng
 
Rich internet application development using the dojo toolkit
alexklaeser
 
Dojo & HTML5
Mike Wilcox
 
Building Real-World Dojo Web Applications
Andrew Ferrier
 
Refactoring legacy code: step-by-step examples
Endava
 
Ria with dojo
Tom Mahieu
 
Practical training general for career services
Vickey Edge
 
DIGITAL EVOLUTION: A SUSTAINABLE APPROACH TO DIGITAL BUSINESS GROWTH
Endava
 
Class Dojo
Laura Antichi
 
Introduction to HTML
Amit Tyagi
 
Ad

Similar to Dojo tutorial (20)

PPTX
Jquery dojo slides
helenmga
 
PDF
Getting Started with Dojo Toolkit
Thomas Koch
 
ODP
Dojo: Beautiful Web Apps, Fast
Gabriel Hamilton
 
PDF
Dojo1.0_Tutorials
tutorialsruby
 
PDF
Dojo1.0_Tutorials
tutorialsruby
 
PDF
JavaScript Library Overview
jeresig
 
PPT
Dojo - from web page to web apps
yoavrubin
 
PPTX
Dojo javascript toolkit
Predhin Sapru
 
PDF
JavaScript Libraries (Kings of Code)
jeresig
 
ODP
DOJO
Mahi Mca
 
PDF
JavaScript Libraries (@Media)
jeresig
 
PDF
How to make Ajax Libraries work for you
Simon Willison
 
PPTX
Dojo training
vadivelan_k
 
PDF
Zero To Dojo
Peter Higgins
 
PPTX
Design Pattern presentation
hoanhtran
 
PDF
dojo.Patterns
Peter Higgins
 
PDF
Trimming The Cruft
Peter Higgins
 
PDF
Test02
testingPdf
 
KEY
Your Library Sucks, and why you should use it.
Peter Higgins
 
ODP
Dojo: Getting Started Today
Gabriel Hamilton
 
Jquery dojo slides
helenmga
 
Getting Started with Dojo Toolkit
Thomas Koch
 
Dojo: Beautiful Web Apps, Fast
Gabriel Hamilton
 
Dojo1.0_Tutorials
tutorialsruby
 
Dojo1.0_Tutorials
tutorialsruby
 
JavaScript Library Overview
jeresig
 
Dojo - from web page to web apps
yoavrubin
 
Dojo javascript toolkit
Predhin Sapru
 
JavaScript Libraries (Kings of Code)
jeresig
 
DOJO
Mahi Mca
 
JavaScript Libraries (@Media)
jeresig
 
How to make Ajax Libraries work for you
Simon Willison
 
Dojo training
vadivelan_k
 
Zero To Dojo
Peter Higgins
 
Design Pattern presentation
hoanhtran
 
dojo.Patterns
Peter Higgins
 
Trimming The Cruft
Peter Higgins
 
Test02
testingPdf
 
Your Library Sucks, and why you should use it.
Peter Higgins
 
Dojo: Getting Started Today
Gabriel Hamilton
 
Ad

More from Girish Srivastava (8)

PPTX
My tableau
Girish Srivastava
 
PPTX
IBM Pure Data System for Analytics (Netezza)
Girish Srivastava
 
PPTX
Jscript part2
Girish Srivastava
 
PPTX
Jscript part1
Girish Srivastava
 
My tableau
Girish Srivastava
 
IBM Pure Data System for Analytics (Netezza)
Girish Srivastava
 
Jscript part2
Girish Srivastava
 
Jscript part1
Girish Srivastava
 

Recently uploaded (20)

PPTX
Introduction to Biochemistry & Cellular Foundations.pptx
marvinnbustamante1
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PPTX
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PPTX
infertility, types,causes, impact, and management
Ritu480198
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PDF
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
Introduction to Biochemistry & Cellular Foundations.pptx
marvinnbustamante1
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
epi editorial commitee meeting presentation
MIPLM
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
infertility, types,causes, impact, and management
Ritu480198
 
Controller Request and Response in Odoo18
Celine George
 
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 

Dojo tutorial

  • 1. Dojo Tutorial Girish Srivastava
  • 2. Objective  In this tutorial, we will learn everything about the dojo. After completing the tutorial you will be able to understand about Dojo framework.  This Dojo tutorial covers:  Introduction to DOJO  Features of Dojo  Why DOJO tool kit?  DOJO tool kit Libraries  Comparison between different tool kits
  • 3. Introduction to Dojo  What is Dojo?  Dojo is JavaScript framework released as open source software. This JavaScript toolkit provides many components to develop rich internet applications.  You can use Dojo toolkit to develop dynamic web applications. Dojo toolkit will put life in your web application and turn it into highly interactive application. You can turn your web application into desktop like web application.  Dojo offers many widgets, utilities and ajax libraries to develop your application.  Dojo is released under BSD or AFL license
  • 5. Features of Dojo  Dojo is based on HTML and JavaScript, so its easy for the developers to learn it fast.  There is no requirement of learning new programming language. Just HTML and JavaScript knowledge if sufficient.  Dojo provides higher abstraction layer to the programmer. So, it helps the programmers to develop powerful functions very easily.  Dojo has already invented the wheels for the programmers and now programmers just have to use the Dojo api into their application  Here is the list of components that comes along with Dojo framework:  DOJO Tree  DOJO Button  DOJO Calendar control  DOJO Grid  DOJO List box  and many more..
  • 14. 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 grade application.  Following are the benefits of Dojo.  Associative arrays  Loosely typed variables  Regular expressions  Objects and classes  Highly evolved date, math, and string libraries  W3C DOM support in the Dojo
  • 15. Disadvantages of Dojo  Developer depends on the browser support for the Dojo  There is no way to hide the Dojo code in case of commercial application
  • 17. JQuery versus Dojo versus YUI • JQuery  Pros: - JQuery is the most popular one of them all. - It is very easy to use and to understand. - The core library is only 15Kb in size. - Their statement is: ‘The Write Less, Do More, Javascript Library’.  Cons: - Hard to use with object oriented programming - JQuery supports plug-ins, but all these plug-ins are not verified. - JQuery is a library
  • 18. •YUI(The Yahoo! User Interface Library)  Pros: - It is developed by Yahoo - Fully documented, with a great API browser - Very consistent and reliable - Also contains unit testing framework - YUI is a framework  Cons: - Heavy page weight - Very few utility or helper functions/methods - Lacks the use of chaining methods together
  • 19. • Dojo Toolkit  Pros: - Debug your code in Firebug - Dojo integrated in Zend Framework - Hierarchical package system speeds loading - Dojo is a framework  Cons: - Dojo fails in online documentation When we compare these 3 libraries/frameworks, I found the following which was quite useful. http://selectors.turnwheel.com/slickspeed.php
  • 20.  Based on these results, we can conclude that YUI is the slowest one. This is also the reason why we didn’t chose for YUI. Dojo and JQuery scores the best.  Knowing that JQuery is the easiest to use and immense popular, Dojo has its advantage of being integrated in Zend Framework. Also, the difference in being a library or framework counts. - A library is about reusable functionalities, but a framework is about reusable behaviours - A library is something you call/inherit from your code, but framework is something that calls your code or provide services for your code - A library is a collection of components and classes, where framework is how abstract classes and components interact with each others  Dojo is a framework and JQuery a library.  JQuery is good for small websites where you want to achieve a ‘WOW’ factor in relative short time.  But when you are building an application, you need a robust
  • 27. Install Dojo  Downloading Dojo  You can download the latest version of Dojo from its official site http://dojotoolkit.org/.  Download the Dojo toolkit directly from http://dojotoolkit.org/download.
  • 32. Dojo Hello World <html> dojo.addOnLoad(init); <head> </script> </head> <title>button</title> <body bgcolor="#FFFFCC"> <script type="text/javascript"> <p align="center"><font size="6" dojo.require("dojo.event.*"); dojo.require("dojo.widget.*"); color="#800000">Welcome to Dojo Project</font></p> dojo.require("dojo.widget.Button"); <button dojoType="Button" function helloPressed() widgetId="helloButton" { onClick="helloPressed();">Hello alert('Click on the Hello World Button'); World!</button> } <br> function init() </body> { </html> var helloButton = dojo.widget.byId('helloButton'); dojo.event.connect(helloButton, 'onClick', 'helloPressed') }
  • 33.  The above example we have created a button "Hello World!". To create a button in dojo you need to a Button Widget that contains three visual states as: mouseOut, mouseOver and mouseDown. To follow the following steps for creating a dojo button widget:  <script type="text/javascript"> // Load Dojo's code relating to widget managing functions dojo.require("dojo.widget.*"); // Load Dojo's code relating to the Button widget dojo.require("dojo.widget.Button"); </script>  dojo.require("dojo.widget.*"): It instructs you to include the dojo widget (Not load all the widgets) for
  • 34.  dojo.require("dojo.widget.Button"): This line instructs you to load the Dojo button widget. If you don't include this line, the markup code for the button would not be evaluated by Dojo upon loading, resulting in a plain HTML button instead of what you expect.  Insert the following code into the HTML body:  <button dojoType="Button" widgetId="helloButton" onClick="helloPressed();">Hello World!</button>  The key attribute of this HTML element to notice is the dojoType attribute. This is responsible for instructing Dojo on how to process the element when the page is loading. In this case you will use abutton element for the button that is used to input element - Dojo will work with either as long as thedojoType attribute is present.
  • 35.  widgetId="helloButton": This is replaced with id="helloButton" without the functionality being affected - Dojo's widget system is smart enough to convert regular idattributes to widgetId's if no widgetId` attribute is explicitly named.  Connecting an Event to the Widget  When you click the command button then it doing something? We specify an onClick event handler for the given command button.  dojo.require("dojo.event.*");  Above code we use "dojo.event.*" that includes all events functionality of Dojo  Like This we can create can create different different examples.  CheckBox …  ComboBox…