This commit is contained in:
2020-01-29 17:55:59 +00:00
parent 8221437440
commit 8def0c4793

View File

@@ -1,16 +1,66 @@
<template>
<v-data-table
caption="My Caption here"
:headers="headers"
:items="records"
:options.sync="options"
:server-items-length="totalRecords"
:loading="loading"
class="elevation-1"
></v-data-table>
<div>
<div>caption: {{ caption }}</div>
<div>apiBaseUrl: {{ apiBaseUrl }}</div>
<div>formKey: {{ formKey }}</div>
<div>dataListKey: {{ dataListKey }}</div>
<div>viewPort is XS: {{ isXS() }}</div>
<v-data-table
:caption="caption"
:headers="headers"
:items="records"
:options.sync="options"
:server-items-length="totalRecords"
:loading="loading"
class="elevation-1"
></v-data-table>
</div>
</template>
<script>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Xeslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
export default {
created() {
//console.log("gz-data-table viewport is XS = " + this.isXS());
},
data() {
return {
loading: true,
options: {},
headers: [],
totalRecords: 0,
records: []
};
},
props: {
apiBaseUrl: {
type: String,
default: "DataList/List"
},
formKey: String,
dataListKey: String,
caption: String
// ,
// rowsPerPage: {
// type: Number,
// default: 100
// }
// likes: Number,
// isPublished: Boolean,
// commentIds: Array,
// author: Object,
// callback: Function,
// contactsPromise: Promise // or any other constructor
},
methods: {
isXS() {
//https://vuetifyjs.com/en/customization/breakpoints#breakpoint-service-object
return this.$vuetify.breakpoint.xs;
}
}
};
/* Xeslint-disable */
//DataTable component
//https://vuetifyjs.com/en/components/data-tables#paginate-and-sort-server-side
@@ -40,6 +90,7 @@ What it needs from it's parent form:
- rows per page
What it needs to provide TO it's parent form
- Custom event for this: https://vuejs.org/v2/guide/components-custom-events.html#sync-Modifier
- Item click info to trigger opening edit form
- Selected items list for mass ops
- error event and message in case of server error or other error so parent can handle it
@@ -233,24 +284,4 @@ TODO:
*/
export default {
created() {
console.log("gz-data-table viewport is XS = " + this.isXS());
},
data() {
return {
loading: true,
options: {},
headers: [],
totalRecords: 0,
records: []
};
},
methods: {
isXS() {
//https://vuetifyjs.com/en/customization/breakpoints#breakpoint-service-object
return this.$vuetify.breakpoint.xs;
}
}
};
</script>