Opened 13 years ago
Closed 12 years ago
#7441 closed feature (wontfix)
Add .disable() and .check() methods
Reported by: | john | Owned by: | john |
---|---|---|---|
Priority: | low | Milestone: | 1.7 |
Component: | attributes | Version: | 1.4.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
These would be very useful (a quick map on top of .attr() and also for mapping to UI widget factory disabling, etc.).
Change History (21)
comment:1 Changed 13 years ago by
Component: | unfiled → attributes |
---|---|
Owner: | set to john |
Status: | new → assigned |
comment:2 Changed 13 years ago by
Status: | assigned → pending |
---|
comment:4 Changed 13 years ago by
Milestone: | 1.5 |
---|---|
Priority: | undecided → low |
Thanks, I've forked the fiddle and have a few brainstorming questions that I've noted in the code as comments.
comment:5 Changed 13 years ago by
Per discussion: This feature provides a convenience method for disabling/enabling form elements that support the disabled
property, as well as any plugins that support listening for triggered "disabled" or "enabled" events.
http://jsfiddle.net/rwaldron/tAnMH/2/
(fixed a typo with trigger("enabled") )
comment:6 Changed 13 years ago by
Will there also be convenience functions for detecting/modifying checked
and selected
elements as part of this change?
comment:7 Changed 13 years ago by
I'd like to see this done a bit differently, with a single .disable(boolean) method. Otherwise the code will often look like $("#thing")[cond?"enable":"disable"]();
comment:8 Changed 12 years ago by
Keywords: | needsreview added |
---|
comment:9 Changed 12 years ago by
Milestone: | → 1.next |
---|
We should consider this for 1.7.
I think the problem of check()/select() is different - as both of those can (and probably should) be manipulated through .val().
comment:11 Changed 12 years ago by
Select should be manipulated through val. Check can't be though. I'm not sure how I feel about all this. It's a little too easy to do this with raw javascript, but this might be something more in dave's direction: http://jsfiddle.net/timmywil/QtacS/3/
comment:12 Changed 12 years ago by
Summary: | Add .disable()/.enable() → Add .disable() and .check() methods |
---|
comment:13 Changed 12 years ago by
Keywords: | 1.7-discuss added |
---|
Nominating ticket for 1.7 discussion.
comment:15 Changed 12 years ago by
-1, again, let's make an official plugin with all those helpers and let's not clobber core anymore than it needs to.
comment:16 Changed 12 years ago by
+0, disable could be convenient. I've gravitated towards against doing .check at all though.
comment:17 Changed 12 years ago by
-1, Don't think this is really needed much anymore, given that we have .attr("checked", true) working.
comment:18 Changed 12 years ago by
-1, I don't think we need help methods for every little thing, these are already straight-forward with existing APIs
comment:19 Changed 12 years ago by
+1, I've been really unclear of the utility of these to begin with
comment:21 Changed 12 years ago by
Keywords: | needsreview 1.7-discuss removed |
---|---|
Milestone: | 1.next → 1.7 |
Resolution: | → wontfix |
Status: | assigned → closed |
We recommend using attr()
Thanks for taking the time to contribute to the jQuery project! Please provide a jsFiddle that outlines practical use cases for your enhancement request.