Merge pull request #2511 from SchrodingersGat/table-pagination-fix

Customize text if totalRows not known
This commit is contained in:
Oliver 2022-01-07 13:44:48 +11:00 committed by GitHub
commit 35561b46ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -371,7 +371,12 @@ function customGroupSorter(sortName, sortOrder, sortData) {
return `${pageNumber} {% trans "rows per page" %}`;
},
formatShowingRows: function(pageFrom, pageTo, totalRows) {
return `{% trans "Showing" %} ${pageFrom} {% trans "to" %} ${pageTo} {% trans "of" %} ${totalRows} {% trans "rows" %}`;
if (totalRows === undefined || totalRows === NaN) {
return '{% trans "Showing all rows" %}';
} else {
return `{% trans "Showing" %} ${pageFrom} {% trans "to" %} ${pageTo} {% trans "of" %} ${totalRows} {% trans "rows" %}`;
}
},
formatSearch: function() {
return '{% trans "Search" %}';