This commit is contained in:
2020-01-31 16:07:22 +00:00
parent a9ab5a4203
commit 350f831181
3 changed files with 26 additions and 25 deletions

View File

@@ -48,7 +48,6 @@ CURRENT TODOs
SHELL / NAV / MENUS / LAYOUT SHELL / NAV / MENUS / LAYOUT
TODO: Test single select still wroking after recent changes
TODO: Save grid settings on paging changes, when open grid get last paging so editing records doesn't lose your position when you come back TODO: Save grid settings on paging changes, when open grid get last paging so editing records doesn't lose your position when you come back
- Also scrollposition - Also scrollposition
TODO: toolbar above grid for filters, refresh etc (make it a standard component?) TODO: toolbar above grid for filters, refresh etc (make it a standard component?)

View File

@@ -649,7 +649,8 @@ export default {
// for form specified or empty object if there is none // for form specified or empty object if there is none
// EAch form is responsible for what it stores and how it initializes, this just provides that // EAch form is responsible for what it stores and how it initializes, this just provides that
// the form does the actual work of what settings it requires // the form does the actual work of what settings it requires
// Form settings are temp and saved, saved ones go into vuex and localstorage and temporary ones are stored in session storage // Form settings are temp and saved, saved ones go into vuex and localstorage and persist a refresh
// and temporary ones are stored in session storage and don't persist a refresh
// //
getFormSettings(formKey) { getFormSettings(formKey) {
return { return {

View File

@@ -5,7 +5,7 @@
:headers="headers" :headers="headers"
:items="records" :items="records"
v-model="selected" v-model="selected"
:options.sync="options" :options.sync="dataTablePagingOptions"
:server-items-length="totalRecords" :server-items-length="totalRecords"
:loading="loading" :loading="loading"
:disable-sort="true" :disable-sort="true"
@@ -98,7 +98,7 @@ export default {
data() { data() {
return { return {
loading: true, loading: true,
options: {}, dataTablePagingOptions: {},
headers: [], headers: [],
serverColumns: [], serverColumns: [],
totalRecords: 0, totalRecords: 0,
@@ -129,7 +129,7 @@ export default {
} }
}, },
watch: { watch: {
options: { dataTablePagingOptions: {
handler() { handler() {
this.getDataFromApi(); this.getDataFromApi();
}, },
@@ -165,8 +165,6 @@ export default {
//i is the actual AyaNova index of that record so we have all we need to open that object //i is the actual AyaNova index of that record so we have all we need to open that object
window.$gz.eventBus.$emit("openobject", { type: typeToOpen, id: i }); window.$gz.eventBus.$emit("openobject", { type: typeToOpen, id: i });
// this.$emit("OPENOBJECT", { type: typeToOpen, id: i });
// alert("STUB: Open object type " + typeToOpen + " with record id of " + i);
}, },
lt(ltKey) { lt(ltKey) {
return window.$gz.locale.get(ltKey); return window.$gz.locale.get(ltKey);
@@ -182,22 +180,7 @@ export default {
//debugger; //debugger;
var that = this; var that = this;
// //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
// }
// });
// }
//DataList/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId=1&mini=true //DataList/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId=1&mini=true
//start with defaults //start with defaults
@@ -207,7 +190,7 @@ export default {
Offset: 0 Offset: 0
}; };
//calculate paging based on settings //calculate paging based on settings
const { page, itemsPerPage } = that.options; const { page, itemsPerPage } = that.dataTablePagingOptions;
if (itemsPerPage && itemsPerPage > 0) { if (itemsPerPage && itemsPerPage > 0) {
listOptions.Offset = (page - 1) * itemsPerPage; listOptions.Offset = (page - 1) * itemsPerPage;
listOptions.Limit = itemsPerPage; listOptions.Limit = itemsPerPage;
@@ -240,10 +223,28 @@ export default {
that.records = buildRecords( that.records = buildRecords(
res.data, res.data,
res.columns, res.columns,
that.$options.filters that.$options.filters //this is the VUE filters collection, nothing to do with the local data structure
); );
that.loading = false; that.loading = false;
that.totalRecords = res.paging.count; 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
}
});
}
})(); })();
}); });
} }