Yeah, I see what you mean. What about .findAndSelf(selector)? Trying to
stick with existing naming conventions...
Do you have some sample scenarios to go along with this need? Like actual
HTML, etc. Would you mind filing a new enhancement ticket for this?
http://dev.jquery.com/newticket

--
Brandon Aaron

On Mon, May 4, 2009 at 6:57 PM, Pappy <helga...@gmail.com> wrote:

>
> While it will be nice to pass in a selector to andSelf, it's a shame
> you'll have to repeat the selector in both the 'find' and 'addSelf'.
> I'd still rather there be only one function necessary.  It's an
> awfully common pattern.  Honestly, I wish 'find' had been this way
> from the start, and there was a descendants function that works like
> 'find' today... it seems much more sane to me.
>
> Hmm... other possible interfaces/names -
> jObject.search(selector)
> jObject.findAll(selector)
> jObject.findInclusive(selector) // my favorite
> jObject.find(selector, "andSelf")
>
> On May 4, 4:47 pm, Brandon Aaron <brandon.aa...@gmail.com> wrote:
> > FYI... There is an open enhancement ticket that proposes adding an
> optional
> > selector to the .andSelf() method.http://dev.jquery.com/ticket/4446
> > --
> > Brandon Aaron
> >
> > On Mon, May 4, 2009 at 5:11 PM, Pappy <helga...@gmail.com> wrote:
> >
> > > Just curious... what's the jQuery-way of saying "Give me all children
> > > that match a filter and include myself if I happen to match as well."?
> >
> > > I've been using -
> >
> > > element.find("*").andSelf().filter([myfilter])
> >
> > > but that seems kludgy.  Is there a better way? If not, I'll just wrap
> > > this as "findInclusive" or "find([filter], true)" or something.
>

Reply via email to