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.79k stars 467 forks source link

Trying to access any select2 method on the select throws an error. #1242

Closed andreccorrea closed 3 years ago

andreccorrea commented 3 years ago

Trying to access any select2 method on the select throws an error. It seems that DAL doesn't pass the select2 class to it.

$('#my_select2').select2('open')

The select2('open') method was called on an element that is not using Select2.
andreccorrea commented 3 years ago

I've discovered that the error occurs because autocomplete.js isn't loaded yet on "$(document).ready()". So, how can I know that it has been initialized?