What timing! The Porteneuve book arrived 30 minutes ago and had the
answer. FYI, here's the observe(0) call that did the trick:
this.control.closeLink.observe('click',this.close.bindAsEventListener(this,this));
1. Use of bindAsEventListener()
2. Passing 'this' as its second argument.
On Apr 9, 10:21 am, Doug Kaye <[EMAIL PROTECTED]> wrote:
> You know the feeling: You're new to the event model(s) and you lose
> track of things easily. :-)
>
> Inside the constructor function for a JS class I dynamically add an
> <a> element. I then use observe() to bind an event-handling function
> for 'click'. Works fine that far. The handler gets control on click
> events. But how do I get access to the instantiated object of the
> class within that handler? I can use Event.element(event) to get the
> <a> element, but how do I get the JS object that established the
> handler?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---