The last couple of years have seen big changes in server-side web programming. Now it's the client's turn; Dojo is the toolkit to make it happen and Mastering Dojo shows you how.
Dojo is a set of client-side JavaScript tools that help you build better web applications. Dojo blurs the line between local, native applications and browser based applications; the browser becomes the user interface platform. "Modern" browsers provide an incomplete, inconvenient, and incompatible programming environment, but Dojo eliminates these problems. While there are many JavaScript libraries available, most focus on just one thing (for example, effects libraries, perceived JavaScript omissions, or HTML widgets). Dojo addresses all of these functional areas-and many others-extensively.
In Mastering Dojo , you'll get the whole story, from basic usage to advanced idioms. Mastering Dojo starts out with a fast moving tutorial that will give you techniques that you can start using right away. You'll learn all about Dojo Core--the foundation on which all things Dojo stand. See how you can modularize your project for development and automatically package your release for optimal download performance. You'll also learn how Dojo: augments the core JavaScript library fixes the event system simplifies DOM programming provides a complete class definition facility includes a powerful remote scripting (XHR) framework ... and much more.
You'll love using Dojo's HTML user interface control widget system, Dijit. See how to use over 40 widgets, including the rich yet easy-to-use tree and grid controls.
Finally, you'll get an in-depth look at how to design and build a single-page, rich Internet Application.
Contents......Page 5
Introduction......Page 9
Key Aspects of Dojo......Page 12
Using the Book......Page 15
Acknowledgments......Page 17
Ajax the Dojo Way......Page 19
Powerful Web Forms Made Easy......Page 20
Installing Dojo on Your Own Server......Page 21
Adding Dojo and Dijit to a Page......Page 22
Laying Out the Form......Page 26
Improved Form Controls......Page 31
Wrapping It Up......Page 34
Dojo Remote Scripting......Page 37
JavaScript Idioms for Calling XHR......Page 39
A Wish List with 4-1dojo.data and 4-1dojox.grid.Grid......Page 46
Researching Cigars Using JSONP......Page 56
Reviews with dojo.xhrGet......Page 63
Errors and Debugging......Page 67
The Dojo APIs......Page 70
Modularizing JavaScript......Page 71
Dojo Source Code Organization......Page 75
Loading Dojo......Page 78
Binding with dojo.hitch......Page 83
JavaScript 1.6 Array Methods......Page 90
Support for Polymorphism......Page 94
Combining, Structuring, and Copying Objects......Page 96
Programming DOM Events with Dojo......Page 101
Connecting to User-Defined Events with Dojo......Page 117
Publish-Subscribe......Page 120
Managing Callbacks with dojo.Deferred......Page 123
Core Dojo DOM Utility Functions......Page 140
Finding and Editing Nodes......Page 145
Inserting, Moving, and Deleting DOM Nodes......Page 158
Positioning DOM Nodes......Page 161
Animation......Page 168
Native Remote Scripting......Page 178
Using the Dojo XHR Framework......Page 180
Remote Scripting with script......Page 199
Remote Scripting with iframe......Page 207
Leveraging Remote Scripting to Access Web Services......Page 211
Bookmarking and the Back Button Without Navigating......Page 218
Why Use Object-Oriented Programming in JavaScript?......Page 225
Defining a Simple Class......Page 226
Defining a Subclass with Single Inheritance......Page 234
Mixins and Multiple Inheritance......Page 239
Preprocessing Constructor Arguments......Page 248
Resolving Property Name Clashes......Page 252
Two-Phase Construction......Page 255
Creating Custom Objects Without Constructors......Page 257
dojo.data......Page 260
The Big Picture......Page 261
dojo.data and Incremental Search......Page 268
Partitioning with QueryReadStore......Page 272
Calling Read Methods from JavaScript......Page 275
A Yahoo Search Driver......Page 280
The Dojo Loader and Build System......Page 286
The Big Picture......Page 287
The Dojo Loader......Page 290
Optimizing Deployment with the Dojo Build System......Page 299
Compressing JavaScript Resources with Dojo-Rhino......Page 313
Advanced Dijit......Page 318
What Exactly Is a Widget?......Page 319
Finding and Manipulating Declarative Widgets......Page 322
Creating Instances Programmatically......Page 327
Extension Points......Page 331
Example: Live Forms......Page 338
A Simple 4-1Tree......Page 341
Hierarchical Data Stores......Page 344
Extension Points......Page 349
Manipulating the 4-1Tree......Page 351
Drag and Drop......Page 356
Grid......Page 366
4-1Grid Display and Design......Page 367
Programmatic Structures......Page 372
Extension Points......Page 375
Cell Editing......Page 385
4-1Grid Manipulation......Page 389
Form Control Features......Page 394
Streamlined Editing......Page 397
Feedback......Page 405
Dates, Numbers, and i18n......Page 409
Action Buttons, Toolbars, and Menus......Page 418
A11y......Page 422
Theme Structure......Page 428
Changing Look and Feel......Page 435
A11y and Themes......Page 440
Panes: ContentPane and TitlePane......Page 442
The Alignment Container: BorderContainer......Page 447
Stack Containers......Page 451
Creating and Extending Widget Classes......Page 455
Widget Classes Using dijit.Declaration......Page 456
Widget Classes Using dojo.declare......Page 461
The Widget Life Cycle......Page 466
Extending Widgets......Page 469
Example: A Yahoo Answers Widget......Page 470
Rich Internet Applications......Page 476
The Big Picture......Page 477
Step 1: Create the Application Skeleton......Page 486
Step 2: The Main Menu and Command System......Page 491
Step 3: A Custom Statusbar Widget......Page 499
Step 4: The Navigator Pane and On-Demand Data Store......Page 505
Step 5: Workspace Objects......Page 515
Foundations......Page 529
Graphics......Page 531
Dojo Data and Storage......Page 532
Appendixes......Page 533
Bibliography......Page 534
C......Page 536
D......Page 537
E......Page 539
I......Page 540
L......Page 541
O......Page 542
S......Page 543
W......Page 544
Z......Page 545