Re: [Django] #36757: Add CSS class to ignore change event in list view

4 views
Skip to first unread message

Django

unread,
Dec 3, 2025, 3:07:14 AM12/3/25
to django-...@googlegroups.com
#36757: Add CSS class to ignore change event in list view
-------------------------------------+-------------------------------------
Reporter: Jacob Rief | Owner: Ahmed
| Asar
Type: New feature | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: wontfix
Keywords: list-view, change- | Triage Stage:
event | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Rief):

Hi Jacob,
that's not the way how django-admin-sortable2 works. There in the list
view, the sorting order is saved immediatly after you drop an item. This
can't be implemented otherwise because the list view doesn't have any
"Save" button.
So what we currently end with, is a resorted list which confuses Django's
JS code, because it assumes that changes have been made to editable
fields. But these changes have already been saved to the database.
I wouldn't even consider this a workaround for django-admin-sortable2 but
for any 3rd party library wanting to change any value.
My current solution is to monkey [patch
django/contrib/admin/static/admin/js/actions.js](https://github.com/jrief
/django-admin-sortable2/blob/master/patches/actions-django-5.2.patch)
which is error prone and hard to maintain.
--
Ticket URL: <https://code.djangoproject.com/ticket/36757#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 3, 2025, 8:12:53 AM12/3/25
to django-...@googlegroups.com
#36757: Add CSS class to ignore change event in list view
-------------------------------------+-------------------------------------
Reporter: Jacob Rief | Owner: Ahmed
| Asar
Type: New feature | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: wontfix
Keywords: list-view, change- | Triage Stage:
event | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

> This can't be implemented otherwise because the list view doesn't have
any "Save" button.

There is a save button if you have `list_editable` enabled. I installed
django-admin-sortable2 (I understand your point that other packages would
benefit, too), I added fields to list_editable including the sort order
field and other text fields, and I noticed with your patch my changes to
the text fields were discarded without a warning.

Feel free to take this to a wider audience if you disagree.
--
Ticket URL: <https://code.djangoproject.com/ticket/36757#comment:6>
Reply all
Reply to author
Forward
0 new messages