Bug Tracker

Opened 9 years ago

Closed 8 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 9 years ago by john

Component: unfiledattributes
Owner: set to john
Status: newassigned

comment:2 Changed 9 years ago by Rick Waldron

Status: assignedpending

Thanks for taking the time to contribute to the jQuery project! Please provide a jsFiddle that outlines practical use cases for your enhancement request.

comment:3 Changed 9 years ago by john

Status: pendingassigned

comment:4 Changed 9 years ago by Rick Waldron

Milestone: 1.5
Priority: undecidedlow

Thanks, I've forked the fiddle and have a few brainstorming questions that I've noted in the code as comments.

http://jsfiddle.net/rwaldron/tAnMH/1/

comment:5 Changed 9 years ago by Rick Waldron

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 9 years ago by snover

Will there also be convenience functions for detecting/modifying checked and selected elements as part of this change?

comment:7 Changed 9 years ago by dmethvin

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 8 years ago by timmywil

Keywords: needsreview added

comment:9 Changed 8 years ago by john

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:10 Changed 8 years ago by timmywil

#9189 is a duplicate of this ticket.

comment:11 Changed 8 years ago by timmywil

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 8 years ago by john

Summary: Add .disable()/.enable()Add .disable() and .check() methods

comment:13 Changed 8 years ago by john

Keywords: 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:14 Changed 8 years ago by Rick Waldron

+1,

comment:15 Changed 8 years ago by jaubourg

-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 8 years ago by timmywil

+0, disable could be convenient. I've gravitated towards against doing .check at all though.

comment:17 Changed 8 years ago by john

-1, Don't think this is really needed much anymore, given that we have .attr("checked", true) working.

comment:18 Changed 8 years ago by scottgonzalez

-1, I don't think we need help methods for every little thing, these are already straight-forward with existing APIs

comment:19 Changed 8 years ago by ajpiano

+1, I've been really unclear of the utility of these to begin with

Version 0, edited 8 years ago by ajpiano (next)

comment:20 Changed 8 years ago by jzaefferer

-1

comment:21 Changed 8 years ago by Rick Waldron

Keywords: needsreview 1.7-discuss removed
Milestone: 1.next1.7
Resolution: wontfix
Status: assignedclosed

We recommend using attr()

Note: See TracTickets for help on using tickets.