-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Settings with data and ajax on a multiple select do not display selected items #89
Comments
Thanks for submitting this. This is interesting. Let me do some tests to see if i can recreate this given you explanation of how your using it. |
There's another issue, I ran into - may or may not be related to this(?) Under certain conditions the preselected value is submitted twice. This is a big problem, because it causes some nasty exceptions when the value is tried to be saved to database with unique keys. I made up a simple reproducer for this issues. It uses PHP for ajax requests and for showing submitted values. Hope that helps |
Have you been able to reproduce these issues? |
Im going to look into this tonight and see if i can replicate this. |
So i was able to replicate this and I think im going to stick with(unless i get a really good reason not to) not auto selected options that have selected: true in it. I couldnt think of a reason why someone would need to auto select values upon doing an ajax request. Change my mind. |
@brianvoe Please reopen. What about this other thing (double submit of preselected values)? Shall I open another separate issue for that? |
Ok the plot thickens on this. The tricky thing about the ajax functionality in general is maintaining selected data from data that doesnt exist in the actual dataset. It might be the case that i need to go back to the drawing board and rethink how this should work. Im open to suggestions and ideas. Thanks. |
Very nice scenario for this is list of selected tags for article. Is it any update for this issue? |
Anyway, quick solution to show selected items in multiple with ajax is to add |
I'm not sure if I have the same error, but for me it seems like if you use ajax, then at the same time initializing the options with |
I would like to re-visit this issue and explain it in much more details: I'm using slimselect with vuejs, so I created a component for slim. Lets say that I have a form to edit a blog post, the blog post as a list of categories (multiple) that I use slimselect input.
|
I am having the same issue, for a situation much like the one given above. :) |
New version of slim select has been released. If this is still an issue let me know and ill try to take care of it. |
Hi @brianvoe
I try to use SlimSelect with following options:
This works without the data option, also without the ajax option, but both together wont.
Here are a few screenshots with what happens:
after loading the page:
opening the dropdown (you can see the disabled items that are actually selected)
After a click somewhere in the pulldown:
The selected items finally appear, but still not with the innerHTML form the data set.
When I scroll down, below the disabled options (only disabled, because already selected) the same options (functionally disabled, but visually enabled) show up a second time.
Searching and majax request work. If I add a new item, it is displayed correctly.
The text was updated successfully, but these errors were encountered: