Mercurial > gemma
diff client/src/components/systemconfiguration/PDFTemplates.vue @ 2738:add2d47c2567
client: tables: implemented simple default sorting
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 19 Mar 2019 18:59:40 +0100 |
parents | 4bcb26542767 |
children | 615b0a9b8098 |
line wrap: on
line diff
--- a/client/src/components/systemconfiguration/PDFTemplates.vue Tue Mar 19 18:07:50 2019 +0100 +++ b/client/src/components/systemconfiguration/PDFTemplates.vue Tue Mar 19 18:59:40 2019 +0100 @@ -14,12 +14,14 @@ <UITableHeader :columns="[ { id: 'name', title: 'Name', class: 'col-4' }, - { id: 'date', title: 'Date', class: 'col-4' }, + { id: 'time', title: 'Date', class: 'col-4' }, { id: 'country', title: 'Country', class: 'col-2' } ]" - :sortable="false" /> - <UITableBody :data="templates" v-slot="{ item: template }"> + <UITableBody + :data="templates | sortTable(sortColumn, sortDirection)" + v-slot="{ item: template }" + > <div class="py-1 col-4">{{ template.name }}</div> <div class="py-1 col-4">{{ template.time }}</div> <div class="py-1 col-2" v-if="template.country"> @@ -78,10 +80,12 @@ * Fadi Abbud <fadi.abbud@intevation.de> */ import { HTTP } from "@/lib/http"; -import { displayError, displayInfo } from "@/lib/errors.js"; +import { displayError, displayInfo } from "@/lib/errors"; +import { sortTable } from "@/lib/mixins"; export default { name: "pdftemplates", + mixins: [sortTable], data() { return { templates: [],