From a5423649f441c0bacbcbe08b45db4c5cb86fd690 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 9 Nov 2020 11:05:07 -0800 Subject: [PATCH] This is the smallest set of changes we can use to work around a change in functionality in Bootstrap Tables. This should remedy some of the issues we've been having with large GET strings being sent to the back-end by the Assets system. --- .../views/partials/bootstrap-table.blade.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index e6143b413..c638c0a5e 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -17,6 +17,16 @@ stickyHeaderOffsetY += +$('.navbar-fixed-top').css('margin-bottom').replace('px',''); } + var blockedFields = "searchable,sortable,switchable,title,visible,formatter,class".split(","); + + var keyBlocked = function(key) { + for(var j in blockedFields) { + if(key === blockedFields[j]) { + return true; + } + } + return false; + } $('.snipe-table').bootstrapTable('destroy').bootstrapTable({ classes: 'table table-responsive table-no-bordered', @@ -42,6 +52,15 @@ pageList: ['10','20', '30','50','100','150','200', '500'], pageSize: {{ (($snipeSettings->per_page!='') && ($snipeSettings->per_page > 0)) ? $snipeSettings->per_page : 20 }}, paginationVAlign: 'both', + queryParams: function (params) { + var newParams = {}; + for(var i in params) { + if(!keyBlocked(i)) { // only send the field if it's not in blockedFields + newParams[i] = params[i]; + } + } + return newParams; + }, formatLoadingMessage: function () { return '

Loading... please wait....

'; },