Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add refresh method to bootstrap-select.js #368

Closed
siebird opened this Issue · 4 comments

5 participants

@siebird

Hi,

I'm currently in need of being able to use the refresh method after manipulating a select menu. I tried adding this myself but have fallen short.

http://silviomoreto.github.io/bootstrap-select/#refresh

@pytkin pytkin added the enhancement label
@shaimo

I need this too in order to be able to disable a select item using javascript. It seems that the flatui bootstrap-select.js is different and incompatible with the recent one at http://silviomoreto.github.io/bootstrap-select/. The latter one does include a refresh() method and their demo page shows it working...

@siebird

I was able to get this working using the render method after manipulating the select menu: $('#some_id').selectpicker('render');
However, if I used multiple selectors like $('#some_id, #someother_id').selectpicker('render'); it would loop through twice and nest the select menu causing it to break.

@kiding

The closest thing to the equivalent of refresh method would be $('select').selectpicker('reloadLi');.
I also had a problem reordering <option> elements, and this method works great.

@andrew-ml
Collaborator

We switched to select2.js plugin in the latest release, please check it out.

@andrew-ml andrew-ml closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.