-
Notifications
You must be signed in to change notification settings - Fork 97
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
How do I put default values in multiselect #41
Comments
Can you post the ajaxSelectPicker code you are using? So we can see your config. |
So we have an option called var optionsGroups = {
ajax: { ... },
log: 3,
preprocessData: function(){ ... },
preserveSelected: true
}; |
Ahh that second image helps. Ok yeah this is a bug. Basically we aren't checking for currently selected on initialization only on update/keydown. It will probably be this weekend before I have time to work on this though. |
+1, I also need this for my system. Thanks |
@diegoaam @MarkCarver I've spent 5 hours on this so far over multiple days and haven't been able to find out why it can't keep initial selected options yet. @MarkCarver If you can find time, I'm pushing up a bugfix branch which has what I've done so far, maybe you'll see something. The commit df4b2b5 has the change I made that will save one of the options but not both. I also added a 4th select to the example page for testing this. |
I'll have to look at this in more depth later. This month is going to be chaotic for me (family/moving). |
Thanks for giving it a quick once over. Just moved myself so fully understand. Good luck! |
Adding this 2.0.0 I really want to get this fixed. |
You need to insert You can try from this fiddle https://jsfiddle.net/kinkongjeng/2o7j08kb/ |
Can confirm that the fix from @jengjeng works and also fixes a secondary bug of de-selecting pre-selected options that must be incorrectly initialised. I'd consider this bug critical and without the workaround we'd have had to implement an alternative library entirely. |
I believe this will be fixed by #164 |
I need to include selected values by default. What I mean is to put pre selected values when I initialize the ajax bootstrap select. I tried using .selectpicker('val',[]) and it puts the values selected but not with the ajax bootstrap select styles, and when I want to add a new value typing on the search input the preselected values are deleted.
The text was updated successfully, but these errors were encountered: