Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#526 closed enhancement (fixed)

Requesting dojo.event.connect always set up "this"

Reported by: [email protected] Owned by: anonymous
Priority: high Milestone:
Component: Core Version: 0.2
Keywords: event, connect, currentTarget Cc: [email protected]
Blocked By: Blocking:


If I set up <div onclick="doSomething(this)">and text</div>, the browser will set up the DIV element as "this" when the handler runs. It would be really nice if Dojo could set up effectively the same thing when I do:

dojo.event.connect(myDiv, "onclick", function(evt) {doSomething(this)})

(The enhancement would also be useful when using "connect" for putting advice on methods.)


Change History (4)

comment:1 Changed 16 years ago by sjmiles

Resolution: fixed
Status: newclosed

We don't call connect functions in the context of the srcObj, but I've modified the event code so that evt.currentTarget is valid (for DOM events). See: for more information.

Re: advice objects, note that in general you can do something like this: dojo.event.connect(myObj, "method", function(evt){ doSomething(myObj) })

comment:2 Changed 16 years ago by sjmiles

Milestone: 0.3release

comment:3 Changed 16 years ago by sjmiles

Keywords: event connect currentTarget added

comment:4 Changed 15 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.