This commit is contained in:
2021-02-01 17:57:34 +00:00
parent d198bea613
commit d1d4267827
2 changed files with 15 additions and 6 deletions

View File

@@ -641,6 +641,10 @@ export default {
///////////////////////////////////////////////
// Simple array equality comparison
// (will NOT work on arrays of objects)
// Array order is relevant here as they are not sorted
// change of order will equal change of array
// as this is required for datatable sortby
//
isEqualArraysOfPrimitives: function(a, b) {
if (a === b) return true;
if (a == null || b == null) return false;

View File

@@ -450,19 +450,24 @@ export default {
)
);
if (
let pagingHaschanged = !(
this.lastDataTablePagingOptions.page ==
this.dataTablePagingOptions.page &&
this.lastDataTablePagingOptions.itemsPerPage ==
this.dataTablePagingOptions.itemsPerPage &&
!sortHasChanged
) {
this.dataTablePagingOptions.itemsPerPage
);
if (!pagingHaschanged && !sortHasChanged) {
//no effective change, return
console.log("NO CHANGE");
return;
}
console.log("Has changed");
if (pagingHaschanged) {
console.log("PAGING Has changed");
}
if (sortHasChanged) {
console.log("SORT Has changed");
}
//has changed something important so refetch and put a pin in last paging settings for next time
this.getDataFromApi();
this.lastDataTablePagingOptions = this.dataTablePagingOptions;