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

sam foster potatosculptor at gmail.com
Mon Mar 8 13:14:04 EST 2010


I'm not assuming NodeList would be the only way to use closest? Why
would it? I realize the ($ || dojo.query)( ... ).whatever() is a
common pattern, but its not the only pattern.

On Fri, Mar 5, 2010 at 5:29 PM, James Burke <jburke at dojotoolkit.org> wrote:
> 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.
>
> James


More information about the dojo-contributors mailing list