{vView}{vViewLabel}{vViewValueStyle}
{vViewValue}{/vViewValue}
{vView}{hView}
{vViewLabel}Part No.{/vViewLabel}
{vView}
{vViewValueStyle}font-weight: bold;TEXT_IMPORTANT{/vViewValueStyle}
It is my Computer Notes. Using Guide : object-key or object-key-key e.g. Step 1 Blog Search : [mysql-run] and then Step 2 ctrl+F [mysql-run] {bookMark me : Ctrl+D}
multiple attribute:<select id="example" name="example" multiple="multiple">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
<option value="5">Option 5</option>
</select>
$(document).ready(function(){
$("#example").multiselect();
});
// example:
$("select").multiselect({
header: "Choose an Option!"
});
| Option | Description | Default |
|---|---|---|
| header | Either a boolean value denoting whether or not to display the header, or a string value. If you pass a string, the default "check all", "uncheck all", and "close" links will be replaced with the specified text. | true |
| height | Height of the checkbox container (scroll area) in pixels. If set to "auto", the height will calculate based on the number of checkboxes in the menu. | 175 |
| minWidth | Minimum width of the entire widget in pixels. Setting to "auto" will disable. | 225 |
| checkAllText | The text of the "check all" link. | Check all |
| uncheckAllText | The text of the "uncheck all" link. | Uncheck All |
| noneSelectedText | The default text the select box when no options have been selected. | Select options |
| selectedText | The text to display in the select box when options are selected (ifselectedList is false). A pound sign (#) will automatically replaced by the number of checkboxes selected. If two pound signs are present in this parameter, the second will be replaced by the total number of checkboxes available. Example: "# of # checked". This parameter also accepts an anonymous function with three arguments: the number of checkboxes checked, the total number of checkboxes, and an array of the checked checkbox DOM elements. See examples for usage. | # selected |
| selectedList | A numeric (or boolean to disable) value denoting whether or not to display the checked opens in a list, and how many. A number greater than 0 denotes the maximum number of list items to display before switching over to the selectedText parameter. A value of 0 or false is disabled. | false |
| show | The name of the effect to use when the menu opens. To control the speed as well, pass in an array: ['slide', 500] | empty string |
| hide | The name of the effect to use when the menu closes. To control the speed as well, pass in an array: ['explode', 500] | empty string |
| autoOpen | A boolean value denoting whether or not to automatically open the menu when the widget is initialized. | false |
| multiple | If set to false, the widget will use radio buttons instead of checkboxes, forcing users to select only one option. | true |
| classes |
New in 1.5!
Additional class(es) to apply to BOTH the button and menu for further customization. Separate multiple classes with a space. You'll need to scope your CSS to differentiate between the button/menu: css /* button */ .ui-multiselect.myClass {} /* menu */ .ui-multiselect-menu.myClass {} | empty string |
| position |
New in 1.5! Requires jQuery 1.4.3+, jQuery UI position utility
This option allows you to position the menu anywhere you'd like relative to the button; centered, above, below (default), etc. Also provides collision detection to flip the menu above the button when near the bottom of the window. If you do not set this option or if the position utility has not been included, the menu will open below the button. Requires the jQuery UIposition utility and jQuery 1.4.3+. Please see this demo for usage instructions. | empty object |
// bind to event
$("#multiselect").bind("multiselectopen", function(event, ui){
// event handler here
});
// or pass in the handler during initialization
$("#multiselect").multiselect({
open: function(event, ui){
// event handler here
}
});
| Event | Description |
|---|---|
| create |
Requires jQuery UI Widget Factory 1.8.6+
Fires when the widget is created for the first time. |
| beforeopen | Fires right before the menu opens. Prevent the menu from opening by returning false in the handler. |
| open | Fires after the widget opens. |
| beforeclose | Fires right before the menu closes. Prevent the menu from closing by returning false in the handler. |
| close | Fires after the widget closes. |
| checkall | Fires when all the options are checked by either clicking the "check all" link in the header, or when the "checkall" method is programatically called (see next section). |
| uncheckall | Fires when all the options are all unchecked by either clicking the "uncheck all" link in the header, or when the "uncheckall" method is programatically called (see next section). |
| optgrouptoggle | Fires when an optgroup label is clicked on. This event receives the original event object as the first argument, and a hash of values as the second argument: js $("#multiselect").bind("multiselectoptgrouptoggle", function(event, ui){ /* event: the original event object, most likely "click" ui.inputs: an array of the checkboxes (DOM elements) inside the optgroup ui.label: the text of the optgroup ui.checked: whether or not the checkboxes were checked or unchecked in the toggle (boolean) */ }); |
| click | Fires when a checkbox is checked or unchecked. js $("#multiselect").on("multiselectclick", function(event, ui) { /* event: the original event object ui.value: value of the checkbox ui.text: text of the checkbox ui.checked: whether or not the input was checked or unchecked (boolean) */ }); |
// example:
$("#multiselect").multiselect("method_name");
| Method | Description |
|---|---|
| open | Opens the menu. |
| close | Closes the menu. |
| refresh | Reloads the checkbox menu. If you're dynamically adding/removing option tags on the original select via AJAX or DOM manipulation methods, call refresh to reflect the changes in the widget. |
| disable | Disable the entire widget. |
| enable | Enable the entire widget. |
| checkAll | Check all checkboxes. |
| uncheckAll | Uncheck all checkboxes. |
| isOpen | Returns a boolean denoting if the widget is currently open or not. |
| getChecked | Returns an array of all the checked checkboxes. |
| getButton |
New in 1.13!
Returns the button element. |
| widget | Returns the menu container (all checkboxes inside). |
| option | Set or get one of the options after the widget has been initialized. If changing an option, the new option setting will take affect immediately. |
| destroy | Destroy the widget, and revert back to the original select box. |
$.ech.multiselect.prototype.options. To configure options that all new instances will inherit, it's easier to set them in this object instead of on an instance-by-instance basis.$.ech.multiselect.prototype.options.selectedText = "# of # selected";
val() on the select box:var values = $("select").val();
getChecked method and map a new array:var array_of_checked_values = $("select").multiselect("getChecked").map(function(){
return this.value;
}).get();
selectedList option from increasing the button's height?.ui-multiselect { height:25px; overflow-x:hidden; padding:2px 0 2px 4px; text-align:left }
// manually check (or uncheck) the third checkbox in the menu:
$("select").multiselect("widget").find(":checkbox").each(function(){
this.click();
});
trigger('click') will not work) due to this bug in jQuery's core.option tag the selected attribute, and then call MultiSelect'srefresh method.| Category | Sub-Category | |
| Model | Description | |