Implement autocomplete dropdown input with django-filters

17 views
Skip to first unread message

Apolalcolo c.

unread,
Dec 16, 2020, 2:04:35 PM12/16/20
to django-filter
Hello,

I tried to search everywhere and also tried some "unusual solutions" using Js to create an autocomplete dropdown instead of bacis choice filter.

I have some long choices list (like :

MY_CHOICES = [ ("HI","Hight"),("LI","Little") ...] 

and instead of create a select using ChoiceFilter I wanted to create an input that propose all possibles values based on what the user write. 

Example : 
- user write H
-input display all MY_CHOICES that begin by "H"
- user write Hi
-input display all value possible
- user click on one of them
-value fill the input

there is any way to do that with django-filters ? 

My solutions don't work well cause the input will display the value "HI" instead of "Hight"

Sorry to disturb you.
Greatings,

Rocher Cyril.

Carlton Gibson

unread,
Dec 16, 2020, 2:10:20 PM12/16/20
to django...@googlegroups.com
Hi. 

Select2 works well for this kind of thing. 
C.

--
You received this message because you are subscribed to the Google Groups "django-filter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-filte...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-filter/379fd205-2386-4ac0-a6ed-d43238b1db95n%40googlegroups.com.

Apolalcolo c.

unread,
Dec 16, 2020, 2:14:46 PM12/16/20
to django-filter
Hello, ok thanks a lot, have a nice day.
Reply all
Reply to author
Forward
0 new messages