jQuery UI Selectmenu
jQuery UI Selectmenu is used to extend the functionality of a native HTML select element. It provides the customization functionality in behavior and appearance far beyond the limitation of a native select.
The jQuery UI Selectmenu widget provides a proper replacement of select element and act as a proxy back to the original select element controlling its state for form submission or serialization.
Example of jQuery UI selectmenu() method
Let's take a simple example to demonstrate the functionality of Selectmenu.
Test it Now
Following is a list of different options that can be used with this method.
||It is used to append the menu. Its default value is NULL.
||If you set this option to true, it disables the Selectmenu. Its default value is FALSE.
||This option is used to specify a button.
||It identifies the position of the menu in relation to the associated button element.
||It specifies the width of the menu in pixels. Its default value is NULL.
Initialize the Selectmenu with the disabled options specified:
Let's take an example to demonstrate the above table options. The following example specifies how to use the disabled option in the jQuery UI Selectmenu example.
There are two ways to use the option "disable":
1) Get the disable option:
1) Set the disable option:
jQueryUI selectmenu() example 2
In the following example, we are using set method:
Let's take an example to demonstrate the usage of selectmenu().
Test it Now
Following is a list of different actions (methods) that can be used with this jQueryUI Selectmenu method.
||This method is used to close the menu. It does not accept any argument.
||It is used to remove the Selectmenu functionality completely and return the element back to its pre-init state. It does not accept any argument.
||It is used to disable the Selectmenu functionality. It does not accept any argument.
||It is used to enable the Selectmenu. It does not accept any argument.
||This method retrieves the instance object of Selectmenu. It does not accept any argument.
||It returns the jQuery object containing the menu element. It does not accept any argument.
||It is used to open the menu. It does not accept any argument.
||It gets an object having the key/value pairs specifying the current Selectmenu options hash.
||It is used to parse the original element and re-render the menu. It does not accept any argument.
||It returns a jQuery object having the button element.