yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.8k stars 468 forks source link

dal incompatible with jQuery-File-Upload #1156

Open daltschu opened 4 years ago

daltschu commented 4 years ago

I have a form with both file fields, foreign keys (ModelChoiceField) and m2m. In the template I want to use jQuery-File-Upload [https://github.com/blueimp/jQuery-File-Upload] to upload the files and dal for the fk and m2m.

I have a javascript/jQuery error on loading the page: TypeError: $("#myfileupload").fileupload() is not a function and the file upload won't work.

When I modify the view so that it's not using dal.autcomplete, the file upload works. Did anyone got this problem before?

Instead of using dal for this view, I moved all the data needed (less than 300 instances) from the model underlying my fk and m2m in a javascript array with the template and used jQuery select2 and it worked fine.

I have dal version 3.5.1 with django 2.2.5 and blueimp-file-upload version 10.24.0

jpic commented 4 years ago

This kind of error means that the plugin is not loaded into jquery, perhaps it was loaded before than another jquery was loaded on $ ?