silentsokolov/django-admin-rangefilter

Uncaught TypeError: django.jQuery is not a function

petrastegaev opened this issue · 3 comments

The filter is not working, I keep getting following error when I click the button:
Uncaught TypeError: django.jQuery is not a function
at datefilter_apply ((index):659:30)
at HTMLInputElement.onclick ((index):713:124)

I have tried adding Django-jquery, adding Media class, adding jQuery to template, nothing helps.
I use default admin, Django 3.2.9.

Fixed this by adding following two lines to change_list.html extension template, I believe it should be added to readme:
<script src={% static 'admin/js/jquery.init.js' %}></script>
<script src={% static 'admin/js/core.js' %}></script>

I checked version 3.2.9 with latest rangefilter is works fine.
Js scripts were load ... http://joxi.net/krDlByJIKPBqkr

Do you override default admin templates?

Yes, change_list.html was extended. As I found out adding <script src={% static 'admin/js/jquery.init.js' %}></script>

<script src={% static 'admin/js/core.js' %}></script> to custom change_list.html fixes the problem.