Pagination alike select input
<infor-bar-selector id="page" data-trigger="true" >
<infor-bar-selector-label>Page:</infor-bar-selector-label>
<infor-bar-selector-option data-value="1" data-selected >1</infor-bar-selector-option>
<infor-bar-selector-option data-value="2" >2</infor-bar-selector-option>
</infor-bar-selector>
Attribute | Description | Default |
---|---|---|
id | Instance identifier | Random string |
data-trigger | Trigger first or selected value on page load | True |
data-selected | Pre-selects an option | First option |
Use _inforBarSelecter.get(id)
to get the instance.
Variable | Parameters | Description |
---|---|---|
onchange() | value: string/int |
Triggers on change with selected value as parameter, can be changed like this instance.onchange = value => { console.log(value) } |
values() | Returns all available options | |
value | Current value | |
addValue() | object: { name: 'name', value: 'value' } |
Appends new option to the bar selector |
removeValue() | value: string/int |
Remove options based on provided value |
removeAllValues() | Removes all options | |
select() | value: string/int trigger: boolean |
Selects an option based on provided value. Triggers onchange based on trigger parameter. Default trigger is true |
selectEq() | value: string/int trigger: boolean |
Selects an option based on provided index. Triggers onchange based on trigger parameter. Default trigger is true |