Select Methods

The Select Methods API of Better-Nice-Select


 

Methods can currently be called like the following:

let select = new betterNiceSelect.BetterNiceSelect('#my-selector');

select.[functionName](parameter);

 

The parameter correspond to the rest parameter syntax and can be useful as example for selecting or deselecting more as one <option> tag.

 

 

deselect

  • Parameter: ...ids
  • Detail: Deselect already added <option> elements via their setted val
  • Example: Select Methods

 

 

deselectAll

  • Parameter: undefined
  • Detail: Deselect all possible <option> elements
  • Example: Select Methods

 

 

destroy

  • Parameter: undefined
  • Detail: Destroy the initialized select HTML node
  • Example: Destroy

 

 

hide

  • Parameter: undefined
  • Detail: Hide the initialized select HTML node
  • Example: Visibility

 

 

open

  • Parameter: searchInput
  • Detail: Open the HTML overlay with the search container to add new items
  • Example: Overlay

 

 

show

  • Parameter: undefined
  • Detail: Shows the initialized select HTML node
  • Example: Visibility

 

 

select

  • Parameter: ...items
  • Detail: Creates new <option> elements for the select field
  • Example: Select Methods

 

 

selectAll

  • Parameter: undefined
  • Detail: Select all possible <option> elements which are available
  • Example: Select Methods