Opened 14 years ago

Closed 7 years ago

#8130 closed defect (patchwelcome)

dojo.setSelectable should be dojo.attr('selectable')

Reported by: nonken Owned by: Eugene Lazutkin
Priority: high Milestone: 1.13
Component: HTML Version: 1.2.1
Keywords: setSelectable, dojo.attr Cc: James Burke, elatzukin
Blocked By: Blocking:


In line with the Dojo api we should offer dojo.setSelectable as dojo.attr('selectable', ...) as well

Change History (8)

comment:1 Changed 13 years ago by dante

Cc: James Burke elatzukin added

fwiw, dojo.attr doesn't handle stuff like this yet well I think.

dojo.attr(n, "checked", false) doesn't do what you think

you need to dojo.removeAttr(n, "checked") to de-check. attr(n, "selectable", Boolean) would likely suffer the same limitation unless special considerations were to take place.

@uhop / @jamestag - is this something we should consider shfiting around with aliases and deprecate set* in 2.0?

comment:2 Changed 13 years ago by Eugene Lazutkin

We need to come up with the general strategy for Boolean properties (selected/checked/disabled/readonly/...). They all have numerous quirks developer should be aware of when setting their values --- the perfect thing for a convenience helper.

comment:3 Changed 13 years ago by Eugene Lazutkin

One way to handle it is to make sure that:

dojo.attr(node, "checked", true);  // should select things
dojo.attr(node, "checked", false); // should deselect things
dojo.attr(node, "checked") instanceof Boolean // should be always true

The only complication implementing this from the top of my head is to make sure that in the radio group only one choice is selected --- it requires some non-trivial code with looping, and potentially document-wide querying.

comment:4 Changed 13 years ago by James Burke

I prefer addressing this in a 2.0 timeframe, since attr does seem to be growing outside just plain attribute get/set into property and attribute get/set. Or at least, I think we have bitten off enough new features for a 1.3 release.

comment:5 Changed 13 years ago by James Burke

Milestone: tbd2.0

comment:6 Changed 11 years ago by Chris Mitchell

Owner: anonymous deleted

comment:7 Changed 10 years ago by bill

Component: GeneralHTML
Owner: set to Eugene Lazutkin
Status: newassigned

comment:8 Changed 7 years ago by dylan

Milestone: 2.01.12
Resolution: patchwelcome
Status: assignedclosed

Given that no one has shown interest in creating a patch in the past 5+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.