- The Book of Dojo
- Quick Installation
- Hello World
- Debugging Tutorial
- Introduction
- Part 1: Life With Dojo
- Part 2: Dijit
- Part 3: JavaScript With Dojo and Dijit
- Part 4: Testing, Tuning and Debugging
- Part 5: DojoX
- The Dojo Book, 0.4
Writing Your Own Widget Class
Submitted by dante on Tue, 06/05/2007 - 18:23.
It's hard for you to leave well-enough alone. We give you widgets, and now you want to change them. Or you want to make your own.
No problem! Dijit components are extendible, so you can make changes without touching the source code. In a way, you already do this by specifying your own attributes - e.g. sliders that go from 0-100 look different than those going from 0-200. But sometimes you need to go further. Maybe you need to create different behavior for onClick, or substitute a custom validation routine. This kind of modification uses extension points described in Common Attributes. You can add your own code to extension points through markup or through pure JavaScript calls to dojo.declare.
You can also create Dijit classes from scratch. Again, you can do this either through markup - using the dijit.Declaration dojoType attribute - or through dojo.declare.
- Printer-friendly version
- Login or register to post comments
- Unsubscribe post
Tutorial - Custom Widget with AOL CDN Hosted Dojo
Take a look at
http://nileshbansal.blogspot.com/2008/03/creating-custom-dojo-widget-usi...
for a guide on writing custom widgets and packaging them.