dojo.connect, dojo.byId and dijit.byId

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);

Related posts:

  1. Html.DropDownList and dojo.byId
  2. disable escape key in dijit.Dialog / dojo dialog
  3. dijit.form.ValidationTextBox and ASP.NET AJAX

Monday, August 25th, 2008 Dojo

No comments yet.

Leave a comment

Search