Bug fix for paginated tables

This commit is contained in:
Oliver Walters 2021-03-02 12:33:01 +11:00
parent 7cf1715e2b
commit 4ff1c690cc

View File

@ -145,10 +145,7 @@ $.fn.inventreeTable = function(options) {
var filters = options.queryParams || options.filters || {}; var filters = options.queryParams || options.filters || {};
options.queryParams = function(params) { options.queryParams = function(params) {
for (var key in filters) {
params[key] = filters[key];
}
// Override the way that we ask the server to sort results // Override the way that we ask the server to sort results
// It seems bootstrap-table does not offer a "native" way to do this... // It seems bootstrap-table does not offer a "native" way to do this...
if ('sort' in params) { if ('sort' in params) {
@ -170,6 +167,15 @@ $.fn.inventreeTable = function(options) {
} }
for (var key in filters) {
params[key] = filters[key];
}
// Add "order" back in (if it was originally specified by InvenTree)
// Annoyingly, "order" shadows some field names in InvenTree...
if ('order' in filters) {
params['order'] = filters['order'];
}
return params; return params;
} }