MultiSelect actions
Seeing how to take an action based on a MultiSelect selection
HTML
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/resources/dojo.css">
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css">
<select id="mySelect" data-dojo-type="dijit.form.MultiSelect">
<option value="foo">Foo</option>
<option value="bar">Bar</option>
<option value="baz">Baz</option>
</select>
JavaScript
// Require things here
dojo.require('dijit.form.MultiSelect');
// Do something once DOM/requires are ready
dojo.ready(function(){
console.log('Dojo and DOM are ready!');
var mySelect = dijit.byId('mySelect');
// mySelect.set('value','100');
dojo.connect(mySelect, 'onChange', mySelect, function(e){
// Because of the second instance of mySelect in the args,
// this === mySelect
// So you can easily get the value
alert("1345678",this.get('value'));
});
});