This commit is contained in:
2021-02-01 18:21:18 +00:00
parent d1d4267827
commit 561800c628

View File

@@ -432,7 +432,7 @@ export default {
},
watch: {
dataTablePagingOptions: {
handler() {
async handler() {
//{ "page": 1, "itemsPerPage": 10, "sortBy": [], "sortDesc": [], "groupBy": [], "groupDesc": [], "mustSort": false, "multiSort": false }
//this code works around some weird bug that causes visible items to be selected in grid (only, not in actual selected array, just a visual thing)
// when breakpoint is switched between wide and narrow either way. No idea why it happens but this fixes that issue and also ensures that there are no
@@ -458,16 +458,18 @@ export default {
);
if (!pagingHaschanged && !sortHasChanged) {
//no effective change, return
console.log("NO CHANGE");
return;
}
if (pagingHaschanged) {
console.log("PAGING Has changed");
}
if (sortHasChanged) {
console.log("SORT Has changed");
//update sort at server and then allow get data
console.log("1 calling api method");
let res = await window.$gz.api.get(
"data-list/listfields?DataListKey=" + this.dataListKey
);
console.log("2 inside sorthaschange back from api method", res);
}
console.log("3 About to call getdata from api");
//has changed something important so refetch and put a pin in last paging settings for next time
this.getDataFromApi();
this.lastDataTablePagingOptions = this.dataTablePagingOptions;