bugfix> jquery > 投稿

HTMLではなくドロップダウンの初期化中に選択したデフォルトオプションを設定するにはどうすればよいですか?データベースから選択した値/オプションを取得しており、変更のドロップダウンを開くたびにそれらを選択したいです。 Eric HyndsのjQuery UI MultiSelect Widgetを使用しています。

var PreSelectedValuesDatabase = “Material in alternative formats (e.g., large print, Braille, e-text):Periodic, Accessible building access (e.g., keyless entry, accessible parking):Periodic, Ergonomics Assessment:Permanent”;
$("#GroupDropDown").multiselect(
            {                   
                height:500, 
                minWidth:500,
                selectedList:false, 
                open: function(event, ui){
                        console.log(event);
                },
                close: function(event, ui){
                           var values = $(this).val();                             
                    }                   
            });            

		<select id='GroupDropDown' name="example-optgroup" multiple="multiple" size="1">
			<optgroup label="Material in alternative formats (e.g., large print, Braille, e-text)">
				<option value="Material in alternative formats (e.g., large print, Braille, e-text):Permanent">Permanent</option>
				<option value="Material in alternative formats (e.g., large print, Braille, e-text):Periodic">Periodic</option>
				<option value="Material in alternative formats (e.g., large print, Braille, e-text):Temporary">Temporary</option>
				<option value="Material in alternative formats (e.g., large print, Braille, e-text):Unknown">Unknown</option>
			</optgroup>
		
			<optgroup label="Accessible building access (e.g., keyless entry, accessible parking)">
				<option value="Accessible building access (e.g., keyless entry, accessible parking):Permanent">Permanent</option>
				<option value="Accessible building access (e.g., keyless entry, accessible parking):Periodic">Periodic</option>
				<option value="Accessible building access (e.g., keyless entry, accessible parking):Temporary">Temporary</option>
				<option value="Accessible building access (e.g., keyless entry, accessible parking):Unknown">Unknown</option>
			</optgroup>
			
			<optgroup label="Ergonomics Assessment">
				<option value="Ergonomics Assessment:Permanent">Permanent</option>
				<option value="Ergonomics Assessment:Periodic">Periodic</option>
				<option value="Ergonomics Assessment:Temporary">Temporary</option>
				<option value="Ergonomics Assessment:Unknown">Unknown</option>
			</optgroup>
		</select>