Learning Dojo 0.9 : Hello Dijit And Tundra
The goal of this exercise is to add a simple Form dijit to the page, and turn on the Tundra visual theme, bundled with Dojo.
Steps to add a button dijit
Load the module by calling dojo.require
<script type="text/javascript"><!--
dojo.require("dijit.form.Button");
// --></script>
Add dijit to the page as markups.
<button id="hello">Hello Dijit</button>
By now what you’ll see in the page is a normal button that has the same look and feel as your browser form elements.
Screenshot
Turn on theme
djConfig
Dojo has predefined djConfig parameters and are applied as dojo.js is being loaded.
<script src="../js/dojo090/dojo/dojo.js"></script>
Here we need to turn one of the parameters on, parseOnLoad. What it does is to tell Dojo to apply styles to dijits as it goes through the page during page load.
tundra.css
This is the stylesheet for theme tundra. In the file it specifies styles for all dijits having applicable styles. I assume any other themes would have same classes and ids, if any, as this one.
Unlike Dojo 0.4.x, the stylesheets are not automatically loaded and applied and the following statement needs to be added to the head.
@import "../js/dojo090/dijit/themes/tundra/tundra.css";
one more step
Add class=”tundra” to body tag.
Screenshot
Example
Example: lab002.html
Source Code: lab002.txt
» Posted in category: ajax, dojo, lab, web development //
This is the bottom of post Learning Dojo 0.9 : Hello Dijit And Tundra





