MultiSelect requires a value to bind, optionLabel and a collection of options. How to define the options property; Providing an array of arbitrary objects along with the optionLabel property to specify the field name of the option.
+Label of an option is used as the display text of an item by default, for custom content support define a template where + the local template variable refers to an option in the options collection.
+In addition #value can be used to customize the selected values display instead of the default comma separated list.
+Filtering allows searching items in the list using an input field at the header. In order to use filtering, enable filter property.
+Name | +Type | +Default | +Description | +
---|---|---|---|
value | +array | +null | +Value of the component. | +
options | +array | +null | +An array of selectitems to display as the available options. | +
optionLabel | +string | +null | +Name of the label field of an option when an arbitrary objects instead of SelectItems are used as options. | +
scrollHeight | +string | +200px | +Height of the viewport in pixels, a scrollbar is defined if height of list exceeds this value. | +
placeholder | +string | +null | +Label to display when there are no selections. | +
disabled | +boolean | +false | +When present, it specifies that the component should be disabled. | +
filter | +boolean | +true | +When specified, displays an input field to filter the items on keyup. | +
tabIndex | +string | +null | +Index of the element in tabbing order. | +
dataKey | +string | +null | +A property to uniquely match the value in options for better performance. | +
filterPlaceholder | +string | +null | +Placeholder text to show when filter input is empty. | +
optionValue | +string | +null | +??? | +
optionDisabled | +boolean | +null | +??? | +
Name | +Parameters | +Description | +
---|---|---|
change | +event.originalEvent: Browser event + event.value: Current selected values + |
+ Callback to invoke when value changes. | +
input | +event: Current selected values + |
+ Callback to invoke when value changes. | +
Following is the list of structural style classes, for theming classes visit
Name | +Element | +
---|---|
p-multiselect | +Container element. | +
p-multiselect-label-container | +Container of the label to display selected items. | +
p-multiselect-label-container | +Label to display selected items. | +
p-multiselect-trigger | +Dropdown button. | +
p-multiselect-filter-container | +Container of filter input. | +
p-multiselect-panel | +Overlay panel for items. | +
p-multiselect-items | +List container of items. | +
p-multiselect-item | +An item in the list. | +
None.
+