On 28 Mar, 13:43, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> When you make the elements, you will still have to give them something
> they can use to find out who created them -- e.g., a reference to the
> instance that created them, or just the name of the constructor
> function [by giving them the return value from this.getCtorName()],
> something like that..

Let me begin by saying thanks for your great reply :)

And you're exactly right, when I create the elements I either have to
give them a reference to the instance (which might be done using
addMethod) or . The thing is I'll be creating lots of them and the
only way to do this in any rational matter is by using onclick, with
addmethod it might be done using this.boundmethodname() and then
creating a special method for each instance of the controlling DOM
element. But it would be more elegant and "cheaper" to just refer to
the class instance as onclick="instancename.instancemethod()".

Just refering to the constructor function wont work since I wont be
creating a new class instance upon the event firing from a static
element, but rather creating the dom element from a static instance of
the class and interacting with it from the created element.

Anyways, just passing the instance name as an argument works fine and
what I'm looking for just seems to be one of those things javascript
just aint built for.
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 rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to