http://dojotoolkit.org
What is dojo?
Dojo is an Open Source DHTML toolkit that is written in JavaScript. For more information, take a look at this:
http://dojotoolkit.org/book/dojo-book-0-9/introduction/dojo-what-it
Quick intro to general function in Dojo:
- dojo.require(String module)
This is how to include other module file to work with.dojo.require("dojo.generalModule");
- dojo.byId(String id)
This sounds like document.getElementById(String id) in standard Javascript.dojo.byId("idNumber");
- dojo.addOnLoad(Function func)
This function will be executed after all the HTML is already loaded.dojo.addOnLoad(someFunction);
- dojo.connect
This is the way to map an event handler (function) to any property or element or object.function sayHello() {
alert("Hello, everyone.");
}
function init() {
dojo.connect(dojo.byId('helloButton'), 'onclick', 'sayHello');
} - dojo.declare
This is all you need when you want to create new widget.
- Name of widget
- Extended widget
- Constructor
- Variables and functionsdojo.declare(
"temp.widget.HelloButton",
[dijit.base.FormElement, dijit.base.TemplatedWidget],
{
required: false,
templateString: "",
onclick: function() {
alert("Hello!!");
}
});
postMixInProperties
We can hook any parameters or functions before rendering HTML page here before manager render this page.
postCreate
If you want to hook any parameters or functions after the manager rendered HTML page, do it here.