Dojo Dijit and HTML5 in Real world applications/Dijit/dijit.form.Select

dijit.form.Select
The use of dijit.form.Select described below can be tested in real life here. Use the "show source" function in your browser to see all code.

How to get a select with fixed width
To get a fixed with on a dijit.form.Select is difficult and a shortcoming of dijit: The only way (as I know of) is to use the style parameter within the widget. It does not work to define the width outside the widget or in CSS. It is important to use "overflow: hidden" as the no other overflow setting is supported. However, overflow: hidden is only partly supported as shown in the example.

The first example is implemented programmatically: See full example and code here.

The second example is implemented declaratively: See full example and code here.

How to set default value on a dijit.form.Select
The example is implemented declaratively: The default is changed by another selector by using obj.set('value', val). See full example and code here.

The example is implemented declaratively: The default is defined at initialization (value:'2'). See full example and code here.

Store-based dijit.form.Select, but gets data from file (db)
Programmatic Implementation. See example and code here.

Verified in
IE8, IE9 (style: 'overflow: hidden' do not destroy the widget, but do not hide overflow either), Firefox 3.6.22, Firefox 10, Google Chrome 16, Dojo 1.6.1 (Do not work in Dojo 1.7.1; under investigation)