This commit is contained in:
2020-01-31 16:40:41 +00:00
parent 350f831181
commit 38b7c9c878

View File

@@ -180,7 +180,6 @@ export default {
//debugger;
var that = this;
//DataList/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId=1&mini=true
//start with defaults
@@ -228,26 +227,29 @@ export default {
that.loading = false;
that.totalRecords = res.paging.count;
//set the list settings in the store since we were successful at retrieval
if (
that.localFormSettings &&
that.localFormSettings.pagination &&
that.localFormSettings.pagination.itemsPerPage
) {
window.$gz.form.setFormSettings(that.formKey, {
temp: { page: that.localFormSettings.pagination.page },
saved: {
itemsPerPage: that.localFormSettings.pagination.itemsPerPage,
sortBy: that.localFormSettings.pagination.sortBy,
descending: that.localFormSettings.pagination.descending
}
});
}
//persist the paging options so user sees same page and list on refresh or leave and return scenario
window.$gz.form.setFormSettings(that.formKey, {
temp: { page: that.dataTablePagingOptions.page },
saved: {
itemsPerPage: that.dataTablePagingOptions.itemsPerPage
}
});
//////////
})();
});
}
},
created() {
//rehydrate last form settings
var formSettings = window.$gz.form.getFormSettings(this.formKey);
if (formSettings.saved && formSettings.saved.itemsPerPage) {
this.dataTablePagingOptions.itemsPerPage =
formSettings.saved.itemsPerPage;
}
if (formSettings.temp && formSettings.temp.page) {
this.dataTablePagingOptions.page = formSettings.temp.page;
}
}
};