This commit is contained in:
@@ -487,9 +487,31 @@ export default {
|
||||
);
|
||||
|
||||
if (!pagingHaschanged && !sortHasChanged) {
|
||||
console.log("NOTHING CHANGED BAILING");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("SOMETHING CHANGED", {
|
||||
loading: this.loading,
|
||||
itWasPaging: pagingHaschanged,
|
||||
itWasSort: sortHasChanged,
|
||||
srt: this.dataTablePagingOptions.sortBy,
|
||||
desc: this.dataTablePagingOptions.sortDesc,
|
||||
lastsrt: this.lastDataTablePagingOptions.sortBy,
|
||||
lastdesc: this.lastDataTablePagingOptions.sortDesc
|
||||
});
|
||||
console.trace();
|
||||
|
||||
//something changed, persist it to last
|
||||
this.lastDataTablePagingOptions = this.dataTablePagingOptions;
|
||||
|
||||
// console.log("AFTER LAST SET", {
|
||||
// srt: this.dataTablePagingOptions.sortBy,
|
||||
// desc: this.dataTablePagingOptions.sortDesc,
|
||||
// lastsrt: this.lastDataTablePagingOptions.sortBy,
|
||||
// lastdesc: this.lastDataTablePagingOptions.sortDesc
|
||||
// });
|
||||
|
||||
if (sortHasChanged && !this.loading) {
|
||||
//update sort at server and then allow get data
|
||||
|
||||
@@ -505,9 +527,8 @@ export default {
|
||||
});
|
||||
}
|
||||
|
||||
//has changed something important so refetch and put a pin in last paging settings for next time
|
||||
//has changed something important so refetch
|
||||
await this.getDataFromApi();
|
||||
this.lastDataTablePagingOptions = this.dataTablePagingOptions;
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
@@ -601,6 +622,7 @@ export default {
|
||||
});
|
||||
},
|
||||
setSortIndicatorsFromDataListResponse(rsort) {
|
||||
console.log("SetSortIndicators - culprit? vm.loading is", this.loading);
|
||||
let sortBy = [];
|
||||
let sortDesc = [];
|
||||
if (rsort != null) {
|
||||
@@ -766,7 +788,10 @@ export default {
|
||||
vm.headers = buildHeaders(res.columns);
|
||||
|
||||
//SET TABLE SORT HERE FROM RESPONSE
|
||||
//BUGBUG: this line is triggering a second fetch, but it shouldn't be since we are in the midst of loading=true which should avoid a getData call
|
||||
console.log("InGetData about to call setsortindicators");
|
||||
vm.setSortIndicatorsFromDataListResponse(res.sortBy);
|
||||
console.log("Back from setSortIndicators, building records...");
|
||||
|
||||
//Post process data here and then set vm.records
|
||||
vm.records = buildRecords(
|
||||
@@ -785,8 +810,14 @@ export default {
|
||||
} catch (err) {
|
||||
window.$gz.errorHandler.handleFormError(err, vm);
|
||||
} finally {
|
||||
vm.loading = false;
|
||||
vm.formState.ready = true;
|
||||
console.log(
|
||||
"InGetData Finally block setting loading to false via nexttick"
|
||||
);
|
||||
vm.$nextTick(() => {
|
||||
console.log("loading false in nexttick");
|
||||
vm.loading = false;
|
||||
vm.formState.ready = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -799,14 +830,6 @@ export default {
|
||||
vm.loading = false;
|
||||
vm.getDataFromApi();
|
||||
}
|
||||
// ,
|
||||
// beforeUpdate() {
|
||||
// // //WTF is beforeUpdate doing and what is resetlxistview doing??
|
||||
// // console.log("data-table: BEFORE UPDATE CALLED WTF?");
|
||||
// // if (this.clientCriteria != null && this.activeFilterId != 0) {
|
||||
// // this.resetLxistView();
|
||||
// // }
|
||||
// }
|
||||
};
|
||||
|
||||
//Called by getDataFromApi on retrieval of list with columnData
|
||||
@@ -1048,7 +1071,6 @@ function buildRecords(listData, columndefinitions, ridColumnOpenable) {
|
||||
}
|
||||
ret.push(o);
|
||||
}
|
||||
console.log("buildRecords ret:", { ...ret });
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user