You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This template is loaded for every "instance" of date filter and make the browser download the same scripts & css multiple times, which slows down the DOM rendering (mostly because of the repetition of scripts inside the HTML document).
A solution for this would be to define a Mixin for the Admin class which defines the needed resources only once using the Media subclass :
I can make a PR, but this will introduce breaking changes, since the inline scripts & resources will be removed from the date_filter.html template and the Mixin will be required to make the filter work.
What do you think about it ? Maybe you have another solution for this ?
The text was updated successfully, but these errors were encountered:
daweedm
changed the title
Performance issue with multiple range filters (same resources : scripts + styles loaded multiples times)
Performance issue with multiple range filters (same resources : scripts + styles loaded multiple times)
Mar 15, 2024
The DOM loading of list_filters is slowed down only when one ore more date range filters are used.
I think this is related to the scripts
<script src=...>
(and styles) that are defined in the following template :django-admin-rangefilter/rangefilter/templates/rangefilter/date_filter.html
Lines 71 to 146 in ceb7ed7
This template is loaded for every "instance" of date filter and make the browser download the same scripts & css multiple times, which slows down the DOM rendering (mostly because of the repetition of scripts inside the HTML document).
A solution for this would be to define a Mixin for the Admin class which defines the needed resources only once using the Media subclass :
I can make a PR, but this will introduce breaking changes, since the inline scripts & resources will be removed from the
date_filter.html
template and the Mixin will be required to make the filter work.What do you think about it ? Maybe you have another solution for this ?
The text was updated successfully, but these errors were encountered: