This dropdown supports single selections as well as multiple sections. See example usage below.
ember install ember-cli-dropdown-list
- Ember.js v2.18 or above
- Ember CLI v2.13 or above
single item selection example
{{dropdown-list
content=myDataList
value=myAwesomeValue
class="chosen-select"
action="myChangeAction"
prompt="Choose your poison"
optionValuePath="content.value"
optionLabelPath="content.label"
}}
multiple item selection example
{{dropdown-list
content=myDataList
value=myAwesomeValues
class="chosen-select"
action="myChangeAction"
prompt="Choose your poisons"
optionValuePath="content.value"
optionLabelPath="content.label"
}}
content: Array<object>
optionValuePath: string denoting the path to an item in the content array to use when updating the value property (see below for information on value)
optionLabelPath: string denoting the path to an item in the content array to use as a nice string to render in the list item
value: object that should be updated with the selected value in the dropdown list. The actual value set is dependent on the optionValuePath
multiple: boolean value denoting whether multiple items in the list can be selected. Default is false.
class: string that should be used as class name for the select element
prompt: optional string to display on the top of the dropdown list when nothing is selected
action: name of function to invoke when the selected option changes
See the Contributing guide for details.
This project is licensed under the MIT License.