Select Menu Methods

Description

The selectmenu plugin has the following methods:

enable/disable

enable: enable a disabled select menu

$( "#select1" ).selectmenu( "enable" );

disable: disable a select menu.

$( "#select1" ).selectmenu( "disable" );

open/close

open: open a closed select menu. This method only works on a custom select.

$( "#select1" ).selectmenu( "open" );

close: close an open select menu. This method only works on a custom select.

$( "#select1" ).selectmenu( "close" );

refresh

refresh: update the custom select menu.

refresh method updates the select menu to reflect changes.

For instance, if the selectedIndex of the native select is updated we can call "refresh" to rebuild the custom select. If you pass a true argument, you can force a refresh and a rebuild to occur.


// Select the menu option and  refresh the menu 
var   myselect = $(  "#select1" ); 
myselect[0].selectedIndex = 5; 
myselect.selectmenu( "refresh"  );

// refresh and  rebuild the list 
myselect.selectmenu( "refresh", true );




















Home »
  jQuery Mobile »
    Tutorial »




jQuery_Mobile
Form
List
Layout
Theme