-
Notifications
You must be signed in to change notification settings - Fork 143
Django-Select2 does not work. #34
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
Comments
@bguerrero5 I don't know how django-select2 implements select2 but you could load select2 js and css, select your dropdown within the script living in your form's html and run .select2() on it.
|
Thank for the fast response @trco. It is still not working. I am not sure whats causing the problem. I am also using crispy froms. Do you think that could be the problem? |
@bguerrero5 You should provide some error log or code so I can see what's happening. It's hard to debug on ''for some reason django-select2 drop down does not work''. |
@trco well I am not getting any error with my interpreter. But, in the console at the browser developer tools i can see a couple of error with the java-script. Attached you can find some screenshots of this errors. The screenshots have been uploaded in the order they appear in the browser. |
@bguerrero5 Is it possible that you didn't include select2 js and css files together with my proposed solution? You're calling select2 function on an element, but the function obviously doesn't exist. |
@trco yeah, i am calling the select2 function. it looks like this. I am not really good with java-script but i believe it is right. {% load static %} {{ title }}× |
@bguerrero5 You should load js and css for select2. Either download it to your static folder and link to it or link to select2 cdns as written in their docs.
|
@trco when i load the js and ccs for select2, it still not works. But now i get a different error at the console. |
@bguerrero5 Unfortunately I can't conclude anything from that. I still suggest you to try out select2 without django-select2. Load js and css and than instantiate select2 on fields you get by their ids. |
Closing due to inactivity. |
Hi,
I implemented django-bootstrap-modal-forms and for some reason django-select2 drop down does not work. By any chance would you have a work around to make django-select to work with django-bootstrap-modal-forms?
The text was updated successfully, but these errors were encountered: