This commit is contained in:
@@ -641,6 +641,10 @@ export default {
|
|||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
// Simple array equality comparison
|
// Simple array equality comparison
|
||||||
// (will NOT work on arrays of objects)
|
// (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) {
|
isEqualArraysOfPrimitives: function(a, b) {
|
||||||
if (a === b) return true;
|
if (a === b) return true;
|
||||||
if (a == null || b == null) return false;
|
if (a == null || b == null) return false;
|
||||||
|
|||||||
@@ -450,19 +450,24 @@ export default {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
let pagingHaschanged = !(
|
||||||
this.lastDataTablePagingOptions.page ==
|
this.lastDataTablePagingOptions.page ==
|
||||||
this.dataTablePagingOptions.page &&
|
this.dataTablePagingOptions.page &&
|
||||||
this.lastDataTablePagingOptions.itemsPerPage ==
|
this.lastDataTablePagingOptions.itemsPerPage ==
|
||||||
this.dataTablePagingOptions.itemsPerPage &&
|
this.dataTablePagingOptions.itemsPerPage
|
||||||
!sortHasChanged
|
);
|
||||||
) {
|
|
||||||
|
if (!pagingHaschanged && !sortHasChanged) {
|
||||||
//no effective change, return
|
//no effective change, return
|
||||||
console.log("NO CHANGE");
|
console.log("NO CHANGE");
|
||||||
return;
|
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
|
//has changed something important so refetch and put a pin in last paging settings for next time
|
||||||
this.getDataFromApi();
|
this.getDataFromApi();
|
||||||
this.lastDataTablePagingOptions = this.dataTablePagingOptions;
|
this.lastDataTablePagingOptions = this.dataTablePagingOptions;
|
||||||
|
|||||||
Reference in New Issue
Block a user