This commit is contained in:
2020-01-29 19:17:54 +00:00
parent 000a7f80bb
commit ca102a50f6

View File

@@ -5,7 +5,7 @@
<div>formKey: {{ formKey }}</div>
<div>dataListKey: {{ dataListKey }}</div>
<div>dataFilterId: {{ dataFilterId }}</div>
<div>viewPort is XS: {{ isXS() }}</div>
<div>viewPort is XS: {{ mini() }}</div>
<v-data-table
:caption="caption"
:headers="headers"
@@ -24,7 +24,7 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////
export default {
created() {
//console.log("gz-data-table viewport is XS = " + this.isXS());
//console.log("gz-data-table viewport is XS = " + this.mini());
},
data() {
return {
@@ -49,9 +49,78 @@ export default {
}
},
methods: {
isXS() {
lt(ltKey) {
return window.$gz.locale.get(ltKey);
},
ltFormat() {
return window.$gz.locale.format();
},
mini() {
//https://vuetifyjs.com/en/customization/breakpoints#breakpoint-service-object
return this.$vuetify.breakpoint.xs;
},
getDataFromApi() {
//debugger;
var that = this;
// var listOptions = {
// offset: 0,
// limit: 5,
// sort: "name",
// asc: true
// };
// if (
// this.localFormSettings.pagination.itemsPerPage &&
// this.localFormSettings.pagination.itemsPerPage > 0
// ) {
// listOptions.offset =
// (this.localFormSettings.pagination.page - 1) *
// this.localFormSettings.pagination.itemsPerPage;
// listOptions.limit = this.localFormSettings.pagination.itemsPerPage;
// }
// listOptions.sort = this.localFormSettings.pagination.sortBy;
// listOptions.asc = !this.localFormSettings.pagination.descending;
// //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
// }
// });
// }
// var listUrl = "Widget/ListWidgets?" + window.$gz.api.buildQuery(listOptions);
//DataList/list?DataListKey=TestWidgetDataList&Offset=0&Limit=999&DataFilterId=1&mini=true
var listOptions = {
DataListKey: that.dataListKey,
Limit: 5,
Offset: 0
};
//is there a filter?
if (that.dataFilterId != 0) {
listOptions["DataFilterID"] = that.dataFilterId;
}
//Mini?
if (that.mini()) {
listOptions["Mini"] = true;
}
this.loading = true;
var listUrl =
that.apiBaseUrl + "?" + window.$gz.api.buildQuery(listOptions);
window.$gz.api.get(listUrl).then(res => {
that.loading = false;
that.Items = res.data;
that.totalItems = res.paging.count;
});
}
}
};