Demo: dijit/Declaration Event Attachments

The following demonstrates defining a custom button widget, and then creating an instance of that widget. Take a look at the source code to see how it works.