Select Events

The Select Events API of Bootstrap-Nice-Select


 

Events can currently be bound only in one way:

let select = document.queryselector("#my-selector");
let componentInit = bootstrapNiceSelect.BootstrapNiceSelect('#my-selector');

select.addEventListener("event-name.bs.bootstrap-nice-select", function(e, arg1,arg2, ...){
    // do something...
});

 

 

Inserted

  • Event: inserted.bs.bootstrap-nice-select
  • Parameter:
Key Description
e.detail.key The key or rather the setted value for the <option> element which is added.
e.detail.value The value or rather the setted innerText for the <option> element which is added.

 

  • Detail: The event is fired immediately after a new option will be added to the <select> field.
  • Example: Inserted

 

 

Removed

  • Event: removed.bs.bootstrap-nice-select
  • Parameter:
Key Description
e.detail.key The key or rather the setted value for the <option> element which is removed.
e.detail.value The value or rather the setted innerText for the <option> element which is removed.

 

  • Detail: The event is fired immediately after an option will be removed from the <select> field.
  • Example: Removed