From 1184ca06ac5f6a3e69947f144a25ee4357bc77ca Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 1 Jul 2022 12:00:21 +1000 Subject: [PATCH] Allows sorting of attachments by 'upload date' (#3275) --- InvenTree/templates/js/translated/attachment.js | 1 + InvenTree/templates/js/translated/tables.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/InvenTree/templates/js/translated/attachment.js b/InvenTree/templates/js/translated/attachment.js index e070cc65b1..19c04b4a80 100644 --- a/InvenTree/templates/js/translated/attachment.js +++ b/InvenTree/templates/js/translated/attachment.js @@ -284,6 +284,7 @@ function loadAttachmentTable(url, options) { }, { field: 'upload_date', + sortable: true, title: '{% trans "Upload Date" %}', formatter: function(value, row) { var html = renderDate(value); diff --git a/InvenTree/templates/js/translated/tables.js b/InvenTree/templates/js/translated/tables.js index b65d46b283..661b3f6f68 100644 --- a/InvenTree/templates/js/translated/tables.js +++ b/InvenTree/templates/js/translated/tables.js @@ -374,6 +374,11 @@ $.fn.inventreeTable = function(options) { options.pageList = [25, 50, 100, 250, 'all']; options.totalField = 'count'; options.dataField = 'results'; + + if (options.sidePagination == null) { + options.sidePagination = 'server'; + } + } else { options.pagination = false; }