This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user