Cannot instantiate an AjaxBootstrapSelect instance without selectpicker first being initialized!
See original GitHub issueI’m trying to use this awesome plugin in a BS modal but I got this:
Cannot instantiate an AjaxBootstrapSelect instance without selectpicker first being initialized!
a piece of code:
selectPartner = jQuery('.select-partner'); selectPartner.selectpicker({ bindEvent: 'keyup paste' }).ajaxSelectPicker({
I’ve tried wrapping ‘ajaxSelectPicker’ in a setTimout and it seems to work.
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (7 by maintainers)
Top Results From Across the Web
truckingsim/Ajax-Bootstrap-Select - Gitter
ERROR] AjaxBootstrapSelect : Cannot instantiate an AjaxBootstrapSelect instance without selectpicker first being initialized!
Read more >Does ajax-bootstrap-select support liveSearch? - Stack Overflow
Yes I have initialised the bootstrap-select before ajax-selectpicker plugin. – Ribu. Oct 17, 2019 at 0:05. e.g. If I ...
Read more >Ajax Bootstrap Select Test - CodePen
URL Extension Required. When linking another Pen as a resource, make sure you use a URL Extension of the type of code you...
Read more >ajax-bootstrap-select - npm
A server that can process AJAX requests and send back appropriate JSON data. Bootstrap Select must either be be initialized with liveSearch ...
Read more >Methods | bootstrap-select · SnapAppointments Developer
If you call val() on the element directly, the bootstrap-select ui will not ... To programmatically update a select with JavaScript, first manipulate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is option to use $(“select.your-ajax-select-class”), not only id. It works in my case.
@dmazilov 's solution works perfectly.
The reason we were seeing that error was because we call this function multiple times… First time, $(“.your-ajax-select-class”)… works just fine.
However, selectpicker puts the same class on the div it creates around the <select> for its own display
Now the next time we do $(“.your-ajax-select-class”)… It tries to add ajaxselectpicker to the div and it fails.
Hence, $(“select.your-ajax-select-class”) solves the issue