Hi Karl/Giulio,
Karl wrote:
> function SomeClass()
> {
> var thisYouWant = this;
> map(function(elem){
> connect(elem, 'onclick',
> thisYouWant, 'onItemClick');
>
> },
> getElementsByTagAndClassName(
> "tr", "ddRow", "newTable"));
> .....
After some experimentaton, this is the solution I stumbled upon.
Guilio wrote:
> map(bind(function(elem) { connect(elem, 'onclick', this,
> 'onItemClick'); }, this),
> getElementsByTagAndClassName("tr", "ddRow", "newTable")
> );
I tried messing around with bind, but couldnt get it working. I tried
binding 'onItemClick' by doing a bind('onItemClick', this) before
calling map and connect. But, that didnt work. I guess I didnt really
understand what bind does.
Thanks for the solutions guys. :)
--
Cheers,
shiva
--
Do not fear to be eccentric in opinion, for every opinion now accepted
was once eccentric.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---