Mercurial > gemma
changeset 2731:7e97337054b9
client: table header component: disable sorting for individual columns
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 19 Mar 2019 14:50:06 +0100 |
parents | c642905c0b3b |
children | 0ab7985ef008 |
files | client/src/components/ui/UITableHeader.vue |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/ui/UITableHeader.vue Tue Mar 19 14:39:04 2019 +0100 +++ b/client/src/components/ui/UITableHeader.vue Tue Mar 19 14:50:06 2019 +0100 @@ -2,18 +2,20 @@ <div :class="['table-header row no-gutters bg-light', { sortable }]"> <a v-for="column in columns" - @click.prevent="sortBy(column.id)" + @click.prevent="!column.disableSorting && sortBy(column.id)" :key="column.id" :class="[ 'd-flex py-1 align-items-center justify-content-center small ' + - column.class || '', + (column.class || '') + + ' ' + + (column.disableSorting ? ' sorting-disabled' : ''), { active: sortColumn === column.id } ]" :style="`width: ${column.width};`" > <span :style="'opacity: ' + (sortColumn === column.id ? '1' : '0.3')" - v-if="sortable" + v-if="sortable && !column.disableSorting" > <font-awesome-icon :icon="sortIcon(column.id)" fixed-width /> </span> @@ -37,7 +39,7 @@ text-decoration: none background-color: #f8f9fa &.sortable - a + a:not(.sorting-disabled) cursor: pointer &:hover, &.active