Opened 13 years ago

Closed 12 years ago

#1673 closed enhancement (fixed)

Select box: Set selected by value, index or title

Reported by: guest Owned by: haysmark
Priority: high Milestone: 0.9
Component: Widgets Version: 0.3
Keywords: select, index, value, title, setSelected Cc:
Blocked By: Blocking:

Description

I'm missing a feature where you can set the selected option in a dojo.widget.Select box by using an index, a value or a title.

This feature request is thus for implementing three functions, e.g:

dojo.widget.Select.setSelectedByIndex(index)
dojo.widget.Select.setSelectedByValue(value)
dojo.widget.Select.setSelectedByTitle(title)

I went to the official Dojo IRC channel on freenode and was asked to put this in the bug tracker as a feature addition for 0.4.1. That's why I've set a Milestone despite not being a Dojo commiter.

Change History (9)

comment:1 Changed 13 years ago by bill

Milestone: 0.4.10.5

Hmm, this is kind of a big feature

  • the part about setting value by index doesn't make sense (in all cases). like what's the index for google's auto-complete? there isn't one.
  • the part about setting the value by value requires a new api to the server.
  • the part about setting value by title... I assume by "title" you mean "label"

Moving to 0.5 for now.

comment:2 Changed 13 years ago by guest

Actually, I just asked for setSelectedByValue() on the IRC channel and it was a guy named slightlyoff IIRC that mentioned I should include index and title in the ticket.

comment:3 Changed 12 years ago by Douglas Hays

Owner: changed from bill to Douglas Hays

comment:4 Changed 12 years ago by haysmark@…

For Select, you now use:

setValue(hiddenvalue)

or:

setTextValue(visiblelabel)

depending on what you have available.

comment:5 Changed 12 years ago by Douglas Hays

Owner: changed from Douglas Hays to haysmark@…

comment:6 Changed 12 years ago by haysmark

Owner: changed from haysmark@… to haysmark

comment:7 Changed 12 years ago by Douglas Hays

Cc: joose@… added

comment:8 Changed 12 years ago by joose

Cc: joose@… removed

comment:9 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.