Learning Dojo

Learning Dojo
eBook: $20.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 30%!
Print + free eBook + free PacktLib access to the book: $55.98    Print cover: $34.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Learn real-world Dojo programming with detailed examples and analysis of source code
  • Comprehensive guide to available Dojo widgets (dijits) and how to use them
  • Extend Dojo by creating your own dijits
  • Highly practical, with hands on examples and short, clear explanations right from the start.

Book Details

Language : English
Paperback : 264 pages [ 235mm x 191mm ]
Release Date : November 2008
ISBN : 1847192688
ISBN 13 : 9781847192684
Author(s) : Peter Svensson
Topics and Technologies : All Books, Web Development, AJAX, Open Source

Table of Contents

Chapter 1: Introduction to Dojo
Chapter 2: Useful JavaScript and Dojo Tricks
Chapter 3: Basic Dijit Knowledge
Chapter 4: Ajax Communication
Chapter 5: Forms
Chapter 6: Layout
Chapter 7: Data, Trees, and Grids
Chapter 8: Real-World Dojo
  • Chapter 1: Introduction to Dojo
    • Dojo usage
    • A sneak peek at Dojo
      • Dynamic charting
      • StackContainer wizard
      • What Dojo is (and isn't)
      • The Dojo foundation
      • How to participate
      • Feature overview
      • Dojo compared to other Ajax frameworks
      • Server-side compatibility
      • Reference sites, API listings, forums, and mailing list
    • Summary
  • Chapter 2: Useful JavaScript and Dojo Tricks
    • Array usage tips and gotchas
    • Functions as arguments
    • JavaScript's prototype-based OO
    • Using closures
    • OO in Dojo
    • Anatomy of a Dojo page
    • Basic Dojo functions
    • Intermediate Dojo functions
    • Logging, Firebug integration, and debugging
    • Event handling in Dojo
    • JSON
    • Summary
  • Chapter 3: Basic Dijit Knowledge
    • The two ways to create Dijits
      • How do I find my widget?
    • What's in the fridge? A smorgasbord of tasty Dijits
    • Dijit structure
      • Lifecycle
      • Templates
      • Attach points
      • Events
      • Extension points
      • Django Templating Language (DTL)
        • Variable substitution
        • Loops
        • Conditionals
        • Argument passing
        • A recommended widget structure
    • Themes
    • I18N
      • djConfig.locale
      • Programmatic locale formatting
      • Accessibility and graceful degradation
    • Summary
  • Chapter 4: Ajax Communication
    • Dojo Ajax features
    • The "Hello World" of Ajax
      • Errors
      • Posting data
      • The content parameter
      • Content-types
    • Script request/JSONP (dojo.io.script)
    • Remote procedure calls
    • Summary
  • Chapter 5: Forms
    • The Form Dijit
    • Generic properties for all Form Dijits
      • Textfields and validation
    • CheckBoxes, radio buttons, and toggle buttons
    • Spinners, sliders, and FilteringSelects
    • TimeTextBox
    • Buttons
    • Ajax integration
    • Summary
  • Chapter 6: Layout
    • Basic Dojo layout facts
    • ContentPane
    • Container functions
      • LayoutContainer
      • SplitContainer
      • StackContainer
      • TabContainer
      • AccordionContainer
      • BorderContainer
    • DragPane
    • ExpandoPane
    • FloatingPane
    • GridContainer
    • RadioGroup
    • ResizeHandle
    • RotatorContainer
    • ScrollPane
    • Compound example using layout
      • The Toolbar
      • The BorderContainer
      • The AccordionContainer
      • The ScrollPane
    • One step forward—creating a widget
    • Summary
  • Chapter 7: Data, Trees, and Grids
    • dojo.data and dojox.data
    • Quick example
    • Models
    • Data sources, stores, and consumers
      • dojo.data.Read
      • dojo.data.Write
      • dojo.data.Identity
      • dojo.data.Notification
      • Common functions for all APIs
    • A simple tree example
    • Forests and trees
      • Tree events
      • Tree styling
      • Tree drag and drop
    • Reading and writing with JsonRestStore
    • Overview of the Grid Dijit
      • A simple Grid
      • Grid views
      • Grid custom rendering
      • Grid sorting
      • Cell editing and styling
    • Summary
  • Chapter 8: Real-World Dojo
    • Using AOL's and Google's CDN
      • Dojo's build system and cross-domain loading
    • Using unit testing with Dojo Objective Harness (DOH)
      • Example 1: Site navigation scaffolding
      • Example 2: Multi-charting application
      • Example 3: CRUD application
    • Summary

Peter Svensson

Peter Svensson is an Ajax evangelist and front-end architect at Nethouse AB. He is
the instigator of the Thin Server Architecture Working Group and a Dojo contributor.
He's an avid JavaScript aficionado who really likes dynamic languages and would
very much appreciate if the rest of the world would catch up really soon.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


- 2 submitted: last submission 10 Sep 2012

Errata type: Typo | Page number: 20

Gfx3d --> "Dojo also sports..." should be "Dojo also supports..."


Errata type: Code | Page number : 35 | Date of errata submision: 03-08-2012.

The code on page 35 is :

b.onclick = function()
alert("Button "+b.innerHTML+" was clicked");

This code is not correct and results in the same problem as the uncorrected code.
Correction should be something along the lines of:

b.onclick = function()
alert("Button "+b.innerHTML+" was clicked");

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Learning Dojo +    Microsoft Dynamics CRM 2011 Application Design =
50% Off
the second eBook
Price for both: £23.15

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Learn tips and tricks in JavaScript that will help you get better at coding in Dojo
  • Explore Dijits (Dojo Widgets) with examples so that you can write your own Dijits
  • Serialize, automatically validate, and convert entered content with forms and layouts
  • Organize different kinds of data in the same Dijit using dojo.data for a better look and feel to your website
  • Animate your content using dojo.fx to give your pages a dynamic look and feel
  • Use closures and Dojo's Class-based OO system underlying all widgets and features
  • Use powerful formatting for Dates and Currencies between locales
  • Understand Dojo's event system, for classical browser events, function 'advice', and Dojo's publish/subscribe message bus
  • Learn to create dynamic Tree widgets using data sources, custom styling, and even drag and drop
  • Create custom widgets and reusable components that use all of Dojo's advanced layout managers and widgets
  • Learn to write custom PHP services to feed data to Dojo's client-side data- driven components

Chapter 1-Introduction to Dojo: This chapter gives an overview of the Dojo AJAX framework along with tips and tricks for using JavaScript and useful, generic Dojo functions.

Chapter 2-”Useful JavaScript and Dojo Tricks explains Dojo's approach to object-oriented JavaScript programming.

Chapter 3-”Basic Dijit knowledge: Dijits is Dojo's name for Widgets. A typical widget is a color-picker or a movable pane. This chapter introduces Dijits in general and gives a lot of examples on how to use them, how they interact, and even an introduction to writing your own.

Chapter 4-”AJAX Communication: This Chapter covers AJAX communication in several aspects, with examples, which also show the view from the server (in PHP code).

Chapter 5-”Forms: This Chapter covers form-related Dijits—serializing forms and powerful validation and internationalization, best practices when setting up Dojo forms, and a run-down of available components.

Chapter 6-”Layouts: The Layout Dijit organizes content, be it other Dijits or plain HTML. We will see a number of examples from simplifying layout in general with 'CSS-less' layout managers, to dynamic loading of content in content panes, and how to create a wizard widget with a Stackcontainer and a small amount of scripting.

Chapter 7-”Data, Trees, and Grids: The datastores are perhaps the most complex area of Dojo, but also give the programmer an unprecedented level of modularity. In this chapter we go over a couple of simple examples, then describe the dojo.data interface, how to extend it, and how to use several different types of data in the same Dijit component.

Chapter 8-”Effects and Animation: dojo.fx gives you a quick way to hide, show, or move something on the page. We have examples on animations and more advanced areas such as animating almost any DOM property over time and how to combine several animations in a chain. We also give examples on how to use the charting and drawing APIs before finishing of with a good dose of Drag and Drop: drag and drop nodetypes, and how to use draggable 'avatars' that change from drag to drop.

Chapter 9-”Real-world Dojo: This chapter is almost entirely examples, focused on giving the reader full-blown guides to creating several types of applications with Dojo, and is also a store for cut-and-paste problem solving when time is of the essence.

In Detail

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.

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.

Learning Dojo gives in-depth as well as practical explanations of using the Dojo AJAX JavaScript Toolkit to create powerful and dynamic websites.


The book is an example-based tutorial. Once the basics are done, it takes the reader through creating a number of examples, each focussed on a different interface task or visual effect.

Who this book is for

This book is for web developers with JavaScript knowledge, who want to use Dojo for developing dynamic Web 2.0 applications.

Readers need basic web-page creation skills, HTML and CSS, and should be comfortable with the syntax of JavaScript.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software