- The Book of Dojo
- The Dojo Book, 0.4
- Part 1: "Introduction"
- Part 2: "Out of the Box" Dojo
- Part 3: "The Dojo Programming Model"
- Part 4: "More on Widgets"
- Part 5: "Connecting the pieces"
- Part 6: "Customizing Dojo Builds for Better Performance"
- Part 7: "Utilities"
- Part 8: "Internationalization and Accessiblity"
- Part 9: "Dojo Community"
- Part 10: "Fresh From The Shed" Dojo
- BookWriting
- Glossary
Understanding Widget Renderers
Submitted by criecke on Thu, 08/10/2006 - 08:40.
Implementations
Widgets can have (but are not required to have) multiple implementations, as follows:
- svg - will run on any svg enabled browser (FF, later safari, soon other browsers)
- vml - will run on IE
- html - can run on any browser
Note that the so-called "html" version of the widget might actually run special code for IE, FF, etc., either through calls to utility functions (such as the graphics library) that branch based on browser version, or "if/else" statements, or whatever.
Which widget gets run?
The HTML file just specifies the widget name, without specifying the
implementation. For example,
<div dojoType="Foo">
Dojo will pick which version of the widget to run based on the user's browser and what versions of the widget are available. For example, on IE, it will run dojo.widget.vml.Foo if it exists, and otherwise run dojo.widget.html.Foo.
Modules for Implementations
There are three separate modules, corresponding to the implementations above:
- dojo.widget.svg
- dojo.widget.vml
- dojo.widget.html
Examples:
1. The Button widget only has a single "html" implementation. It's defined in dojo.widget.html.Button2. In the future, the Chart widget will have both "svg" and "vml" implementations, defined in dojo.widget.svg.Chart and dojo.widget.vml.Chart. (The widget doesn't instantiate at all on browsers that don't match either svg or vml) Author: the stick
