Look at the MochiKit.Query module of the MochiKit Extensions (http://
launchpad.net/mochikit-ext).
It provides jQuery style signal functions...

MochiKit.Query('#my-ul li').click(function(evt){
   // handle events here
});

or

MochiKit.Query('#my-ul li').click(some_callback);

then you can signal to matched elements by simply calling...

MochiKit.Query('#my-ul li').click();

Regards
--
Amit

On Dec 12, 9:45 pm, Eoghan <[email protected]> wrote:
> I often use the following utility function:
>
>     function connectEach(iterable, signal, dest, func){
>         forEach(iterable, function(el){
>                 connect(el, signal, dest, func);
>             });
>     }
>
> It might be used as follows:
>
>     connectEach($$('#my-ul li'), 'onclick', function(e){
>                 // do sumn'
>          });
>
> rather than slightly more unwieldy:
>     forEach($$('#my-ul li'), function(el){
>             connect(el, 'onclick', function(e){
>                     // do sumn'
>                 });
>          });
>
> Is it a good candidate to include in the Signal api?
>
> Eoghan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to