Refactored sorting JS files to be includes so that server-side variables may be passed to them.
Added 'after_sorting_js_callback_name' attribute to SortableAdminBase. Added callback to be executed after sorting for each of the possible sorting scenarios. Added custom template examples to add a callback to be executed when sorting is finished.
This commit is contained in:
@@ -83,6 +83,9 @@ class ProjectAdmin(SortableAdmin):
|
||||
NonSortableCreditInline, NonSortableNoteInline
|
||||
]
|
||||
list_display = ['__str__', 'category']
|
||||
after_sorting_js_callback_name = 'afterSortCallback'
|
||||
sortable_change_list_template = 'adminsortable/custom_change_list.html'
|
||||
sortable_change_form_template = "adminsortable/custom_change_form.html"
|
||||
|
||||
admin.site.register(Project, ProjectAdmin)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user