Opened 14 years ago
Closed 12 years ago
#4596 closed feature (wontfix)
find function including the results of filter?
Reported by: | kazar | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | traversing | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
Hi,
Just an idea - I often find myself doing something like:
$(this).filter(".a-class").add($(this).find(".a-class"));
I (personally) find this a bit clunky. Was wondering if it was sensible to perhaps make find include the results of a filter over the set of elements, so i would just have to do this:
$(this).find(".a-class", { withset: true });
(or something along those lines), just seems cleaner to me, especially because I seem to end up doing that first bit of code a lot.
Cheers
Change History (16)
comment:1 Changed 13 years ago by
Component: | unfiled → traversing |
---|
comment:2 Changed 12 years ago by
Keywords: | needsreview added |
---|---|
Milestone: | 1.4 → 1.5 |
Priority: | trivial → low |
comment:3 Changed 12 years ago by
Milestone: | → 1.next |
---|---|
Status: | new → open |
comment:6 Changed 12 years ago by
Description: | modified (diff) |
---|
-1, can be easily accomplished with existing api; proposal is confusing
comment:8 Changed 12 years ago by
Description: | modified (diff) |
---|
+0, I think this is kind of confusing as "findFilter," can we come up with a better name, at least?
comment:9 Changed 12 years ago by
Description: | modified (diff) |
---|
+0, possibly as a new function to make the API clear.
comment:10 Changed 12 years ago by
-1, i think adding more options just muddles up the api - it's easily possible with the current API and a plugin could be written to make $.fn.findAndAdd or something
comment:11 Changed 12 years ago by
+1, I find myself doing this (or equivalent) all the time. I don't agree with the API proposed (it should be much simpler, like .filterFind()).
comment:12 Changed 12 years ago by
+1, I really don't like the proposed API, but I'm in favor of a new method with this functionality
comment:15 Changed 12 years ago by
-1, No need for a separate method or option, as this could be accomplished with #4446 $(this).find(selector).andSelf(selector);
comment:16 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Keywords: | needsreview 1.7-discuss removed |
Resolution: | → wontfix |
Status: | open → closed |
Let's consider this for 1.7, I've often wanted a method similar to this - perhaps something like .findFilter().