Allows sorting of attachments by 'upload date' (#3275)

This commit is contained in:
Oliver 2022-07-01 12:00:21 +10:00 committed by GitHub
parent efbef2dc90
commit 1184ca06ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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);

View File

@ -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;
}