1.0.5 • Published 1 year ago

@dariovinci/bs-multiselect v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Wrap an input (an optionally a label) field in a div and choose an id. Example: multiselect-test

<div id="multiselect-users-wrapper">
    <input type="text" class="form-control">
    <label for="multiselect-users">Utenti</label>
</div>

You can also use bs-multiselect with form floating. Example:

<div id="multiselect-test">
    <div class="form-floating">
        <input type="text" class="form-control">
        <label for="multiselect-users">Utenti</label>
    </div>
</div>

Then in your js file add:

const multiselect_test = new BsMultiselect({
  inputId: '#multiselect-test',
  dataArray: [],
  selectAll: true,
  showCompactSelection: true,
  maxHeight: 200px,
  showSearchBox: true,
});
const multiselect_test = new BsMultiselect({
  inputId: '#multiselect-test',
  dataArray: [],
  selectAll: true,
  showCompactSelection: true,
  maxHeight: 200px,
  showSearchBox: true,
  ajaxCreateDataArray: (resp) => {
    let dataArray = [];
    for (let i = 0; i < resp.length; i++) {
	const element = resp[i];
	dataArray.push({
	    value: element.id,
	    text: element.name
	})

    }
    return dataArray;
}
});
1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago