]> source.dussan.org Git - jquery-ui.git/commitdiff
fixed: its now possible to have a disabled and selected option on init, see #234
authorFelix Nagel <info@felixnagel.com>
Fri, 20 Jul 2012 21:06:58 +0000 (23:06 +0200)
committerFelix Nagel <info@felixnagel.com>
Fri, 20 Jul 2012 21:06:58 +0000 (23:06 +0200)
demos/selectmenu/disable_enable.html
ui/jquery.ui.selectmenu.js

index fd3191d789aa4da0d3d7b272ec9adaec5c9b7852..b8294137494e32f89484d965470f61ed36c4f7b1 100644 (file)
@@ -67,7 +67,9 @@
                        
                        var speedC = $('select#speedC').selectmenu();
                        
-                       var speedD = $('select#speedD').selectmenu();           
+                       var speedD = $('select#speedD').selectmenu();
+                       
+                       var speedD_first = $('select#speedD_first').selectmenu();               
 
                        var speedD2 = $('select#speedD2').selectmenu();                         
                        $("#optgroupSwitch").toggle(
                        </select>
                </fieldset>
                                
+               <fieldset>
+                       <label for="speedD_first">Disabled and selected first option by HTML</label>
+                       <select id="speedD_first">
+                               <option disabled="disabled" selected="selected">Choose one...</option>
+                               <option>Option 1</option>
+                               <option>Option 2</option>
+                               <option>Option 3</option>
+                       <select>
+               </fieldset>
+                               
                <fieldset>
                        <label for="speedD3">Disabled optgroup by HTML</label>
                        <select name="speedD3" id="speedD3">
index 7b6e4e7cf880756681ff98c0b2b0086d08c118fb..527d40eae2ab2448f8c0fc7f34ccd0f23de2deb8 100644 (file)
@@ -436,7 +436,7 @@ $.widget("ui.selectmenu", {
                }
 
                // update value
-               this.index( this._selectedIndex() );
+               this._refreshValue();
 
                // set selected item so movefocus has intial state
                this._selectedOptionLi().addClass(this.widgetBaseClass + '-item-focus');