mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
#66 fix clickable header behaviour for special cases
This commit is contained in:
parent
4cf31f0d1e
commit
5319726a22
@ -8,8 +8,9 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<!-- Columns -->
|
||||
<th class="mdl-data-table__cell--non-numeric column-header {{col.cssClass}}"
|
||||
<th class="mdl-data-table__cell--non-numeric {{col.cssClass}}"
|
||||
*ngFor="#col of columns"
|
||||
[class.column-header]="col.title"
|
||||
[class.mdl-data-table__header--sorted-ascending]="sorting.key === col.source && sorting.direction === 'asc'"
|
||||
[class.mdl-data-table__header--sorted-descending]="sorting.key === col.source && sorting.direction === 'desc'"
|
||||
(click)="onColumnHeaderClick(col)">
|
||||
|
@ -332,7 +332,7 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit
|
||||
}
|
||||
|
||||
onColumnHeaderClick(column: ContentColumnModel) {
|
||||
if (column) {
|
||||
if (column && this._isSortableColumn(column)) {
|
||||
if (this.sorting.key === column.source) {
|
||||
this.sorting.direction = this.sorting.direction === 'asc' ? 'desc' : 'asc';
|
||||
} else {
|
||||
@ -368,4 +368,8 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit
|
||||
private _hasEntries(node: NodePaging): boolean {
|
||||
return (node && node.list && node.list.entries && node.list.entries.length > 0);
|
||||
}
|
||||
|
||||
private _isSortableColumn(column: ContentColumnModel) {
|
||||
return column && column.source && !column.source.startsWith('$');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user