From e6e408e89b55595fce4e9ce799ba06f487cc9b91 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Wed, 10 Jul 2019 17:30:54 +0300 Subject: [PATCH] Doc update for table --- src/views/datatable/DataTableDoc.vue | 142 +++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) diff --git a/src/views/datatable/DataTableDoc.vue b/src/views/datatable/DataTableDoc.vue index 72e87bfdc..c8a76e29d 100644 --- a/src/views/datatable/DataTableDoc.vue +++ b/src/views/datatable/DataTableDoc.vue @@ -570,6 +570,148 @@ export default { } } + +

Empty Message

+

When there is no data, you may use the empty template to display a message.

+ + + + +

Loading

+

A loading status indicator can be displayed when the loading property is enabled. The icon is customized through loadingIcon property.

+ + + + + +import CarService from '../../service/CarService'; + +export default { + data() { + return { + loading: false, + cars: null + } + }, + datasource: null, + carService: null, + created() { + this.carService = new CarService(); + }, + mounted() { + this.loading = true; + + this.carService.getCarsLarge().then(data => { + this.cars = data + this.loading = false; + }); + } +} + + +

Responsive

+

DataTable display can be optimized according to screen sizes, this example demonstrates a demo where columns are stacked on small screens.

+ + + + + +import CarService from '../../service/CarService'; + +export default { + data() { + return { + cars: null + } + }, + carService: null, + created() { + this.carService = new CarService(); + }, + mounted() { + this.carService.getCarsSmall().then(data => this.cars = data); + } +} + + + +.p-datatable-responsive .p-datatable-tbody > tr > td .p-column-title { + display: none; +} + +@media screen and (max-width: 40em) { + .p-datatable-responsive .p-datatable-thead > tr > th, + .p-datatable-responsive .p-datatable-tfoot > tr > td { + display: none !important; + } + + .p-datatable-responsive .p-datatable-tbody > tr > td { + text-align: left; + display: block; + border: 0 none; + width: 100% !important; + float: left; + clear: left; + } + + .p-datatable-responsive .p-datatable-tbody > tr > td .p-column-title { + padding: .4em; + min-width: 30%; + display: inline-block; + margin: -.4em 1em -.4em -.4em; + font-weight: bold; + } +} + + +

Properties