Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Multi Select Docs #539

Open
toomanylogins opened this issue Sep 5, 2024 · 4 comments
Open

Error in Multi Select Docs #539

toomanylogins opened this issue Sep 5, 2024 · 4 comments

Comments

@toomanylogins
Copy link

There is an error in the docs

https://coreui.io/bootstrap/docs/forms/multi-select/

Should this be a datepicker ?

const mulitSelectElementList = Array.prototype.slice.call(document.querySelectorAll('.form-multi-select')) const mulitSelectList = mulitSelectElementList.map(mulitSelectEl => { return new coreui.DatePicker(mulitSelectEl, { // options }) })

@mrholek
Copy link
Member

mrholek commented Sep 5, 2024

Thanks. I fixed it https://coreui.io/bootstrap/docs/forms/multi-select/

@toomanylogins
Copy link
Author

No thank you for a brilliant template.
While we are here. I am using multi select with data attributes and trying to update the select options via an ajx call. I can populate the options in the html select element after search keyup but how do I call update method to refresh the multi-select?

@mrholek
Copy link
Member

mrholek commented Sep 5, 2024

You can try something like this

<select id="mulitSelectEl" class="form-multi-select"></select>

const mulitSelectEl = document.getElementById('mulitSelectEl')
const multiselect = coreui.MultiSelect.getInstance(mulitSelectEl) // Retrieve a MultiSelect instance

multiselect.update({...})

@toomanylogins
Copy link
Author

Thanks for reply. Gave up with attributes now trying json. Is it possible to update after type in search via $.ajax call? Trying to understand multiselect.update({...}) Is that the new option collection ie multiselect.update({option:'newdata'})

I would like to keep the dropdown on show as user typing. The issue is I have a very long list.

If not possible I will add a separate search box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants