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: { watch: {
dataTablePagingOptions: { dataTablePagingOptions: {
handler() { async handler() {
//{ "page": 1, "itemsPerPage": 10, "sortBy": [], "sortDesc": [], "groupBy": [], "groupDesc": [], "mustSort": false, "multiSort": false } //{ "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) //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 // 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) { if (!pagingHaschanged && !sortHasChanged) {
//no effective change, return
console.log("NO CHANGE");
return; return;
} }
if (pagingHaschanged) {
console.log("PAGING Has changed");
}
if (sortHasChanged) { 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 //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;