[dojo-contributors] live() and delegate() prototype

James Burke jburke at dojotoolkit.org
Fri Mar 5 12:29:58 EST 2010

On Thu, Mar 4, 2010 at 10:55 PM, Bill Keese <bill at dojotoolkit.org> wrote:
> PS:
>> I like dojo(x).live(), and a .delegate method on dojo.NodeList, but
>> hopefully we would have a .delegate that works outside the NodeList
>> context.
> We could do that, but it seemed like we were moving away from that
> model.  For example IIUC closest() only works on a NodeList, even though
> it's usually called on a single element.    And for 2.0 I assume that
> NodeList (and dojo.query()) will be the only interface for dealing with
> nodes.

I forgot for a moment this new delegate takes a css3 selector. I was
thinking about a pattern I do now where I bind a click handler on a
parent node and use child a tags with hrefs that are fragment IDs
(#methodname) and dispatch to that method name in the code. I mixed up
two different things on my head. So, having a delegate just on
NodeList that takes a CSS3 selector makes sense.


More information about the dojo-contributors mailing list