I think this is what I was looking for. I was unaware that 'this' was
available in the context of an event handler function. However, it
seems in my case it is not. Trying to assign this.target(); to a
variable produces the following error: this.target is not a function.
Is that only available in SVN? I am using 1.3.1 release. Thanks.
On Mar 27, 10:48 am, "Brian Morton" <[EMAIL PROTECTED]> wrote:
> Jorge replied to my email and suggested the following:
> -------------------------------------------------------------------------------
>
> Yes, you can add parameters to be passed together with the event.
> Take a look
> at the docs for the Async module.
>
> Even if you couldn't, though, you could use attributes on each button
> to know
> what row it is referring to. For example something like
> 'name="delete-32"' to
> work with record with id 32.
>
> If you already have the id, it is a matter of getting the parentNode
> id:
>
> (pseudo-HTML)
> <div id='record-32'>
> <!-- other element here -->
> <button id='delete' />
> </div>
>
> (pseudo-JS)
> var delete_evt = function(evt) {
> element = this.target();
> id = element.parentNode.id;
> // ...
>
> }
>
> On Mar 27, 10:35 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
> > On Tuesday 27 March 2007 16:22, Brian Morton wrote:
>
> > > Sorry for the dup Jorge, I replied to your email instead of replying
> > > to the post.
>
> > > I guess what I'm getting at is how do I pass this to my controller? I
> > > am gathering that the only argument that gets passed to an event wired
> > > up with MochiKit.Signal is evt. Can I add an argument to be passed
> > > when an onclick is fired? Right now, the event object contains no
> > > information about what element originated this click event, so I don't
> > > know where to pull the info from. It could be an edit or delete link
> > > on any row. I put my record id in the name attribute of the row, and
> > > a unique sequential identifier as the id of each row.
>
> > You can use partial to create functions with pre-bound arguments. Pass these
> > as signal-targets.
>
> > Diez
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" 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/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---