Home > Dojo > dojo.connect, dojo.byId and dijit.byId

dojo.connect, dojo.byId and dijit.byId

August 25th, 2008

When connecting events to simple DOM elements you use standard w3c event handlers. Here is a list of the DOM events implemented in gecko based browsers.

example 1:

   1:  dojo.connect(dojo.byId('htmlElement'), ‘onclick’, myFunction);

example 2:

   1:  dojo.connect(dojo.byId('htmlElement'),'onclick',function(){
   2:      dijit.byId('myDigit').show();
   3:  });

Doing the same thing with Dijits you need to use the available methods..they have the same name but are in camel case.

onClick

onBlur

onChance

Here is a link to the dijit.form.Button for example: dijit.form.Button

example:

   1:  dojo.connect(dijit.byId('myDijit'), 'onClick', doSomething);
Share and Enjoy:
  • Digg
  • Facebook
  • del.icio.us
  • Print this article!
  • E-mail this story to a friend!
  • Google
  • description
  • description
  • Live
  • MySpace
  • Reddit
  • StumbleUpon
  • Technorati
  • Tumblr

Dojo

  1. No comments yet.
  1. No trackbacks yet.