Skip to content
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

New example with autocomplete-light instead of select2 #1330

Closed
wants to merge 2,398 commits into from
Closed

Conversation

jpic
Copy link
Member

@jpic jpic commented May 22, 2023

This is a pretty simple example using the simple autocomplete-light.js web component which offers the following advantages over select2:

  • lightweight, 312 SLOCs of JS
  • doesn't use jQuery
  • doesn't need any "lifecycle code" (the code that initializes etc ... and does not always work ie Javascript isn't correctly initialized when loaded with HTMX #1311), because it's a web component
  • you can template all rendering output in python, there's no JS template or whatnot, it's like the originial JS script of DAL < v3
  • we have full control on it

And the following drawbacks:

  • most features from DAL not added
  • addanother not added
  • in admin neither
  • it's a web-component so I don't know perhaps it won't work on some very old browsers

That said, we can start building on that, it's not bothering the select2 implementation code nor breaking compatibility AFAIK.

jpic and others added 30 commits August 12, 2018 09:49
In the example given, the forward argument in line 590: ```forward=(forward.Self())``` isn't a tuple. So I've updated the example to correct the error and also added a reminder that the forward argument expects a tuple.
Django2 introduced the SELECT2_TRANSLATIONS dictionary, and this
was imported into the dal_select2.widgets module, causing an ImportError
when run against any version of Django < 2.

Fixes #1029
Django 2.1 has been released last week, so adding it to the build matrix
This makes select2 copy the CSS classes from original select element to the generated element.
…ms with their own jQuery.

This was a major mind bender to figure out, but the detailed comments I've left
should (hopefully) explain what's going on.
so that tox uses python version specified in travis.yml
Switches from using an unsupported private API (which changed and broke
from django-querysetseqence>0.7) to a newly added public api method
(`get_querysets`) which achieves the same thing.

Depends on clokep/django-querysetsequence#53
Supersedes #1056
Fixes #1050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.