diff --git a/src/components/treetable/TreeTable.vue b/src/components/treetable/TreeTable.vue index d1eece4b5..9f9b7e12e 100644 --- a/src/components/treetable/TreeTable.vue +++ b/src/components/treetable/TreeTable.vue @@ -351,7 +351,7 @@ export default { this.$emit('update:first', this.d_first); }, getColumnHeaderClass(column) { - const sorted = this.sortMode === 'single' ? (this.d_sortField === (column.field || column.sortField)) : this.getMultiSortMetaIndex(column) > -1; + const sorted = this.isColumnSorted(column); return [column.headerClass, {'p-sortable-column': column.sortable}, @@ -359,6 +359,12 @@ export default { {'p-highlight': sorted} ]; }, + isColumnSorted(column) { + if (column.sortable) + return this.sortMode === 'single' ? (this.d_sortField === (column.field || column.sortField)) : this.getMultiSortMetaIndex(column) > -1; + else + return false; + }, getSortableColumnIcon(column) { let sorted = false; let sortOrder = null;