File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
projects/components/src/table Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,9 @@ export class TableComponent
307
307
@Output ( )
308
308
public readonly columnConfigsChange : EventEmitter < TableColumnConfig [ ] > = new EventEmitter < TableColumnConfig [ ] > ( ) ;
309
309
310
+ @Output ( )
311
+ public readonly sortChange : EventEmitter < SortedColumn > = new EventEmitter < SortedColumn > ( ) ;
312
+
310
313
@ViewChild ( PaginatorComponent )
311
314
public paginator ?: PaginatorComponent ;
312
315
@@ -537,10 +540,12 @@ export class TableComponent
537
540
538
541
public onSortChange ( direction : TableSortDirection , columnConfig : TableColumnConfigExtended ) : void {
539
542
if ( TableCdkColumnUtil . isColumnSortable ( columnConfig ) ) {
540
- this . updateSort ( {
543
+ const sortedColumn : SortedColumn = {
541
544
column : columnConfig ,
542
545
direction : direction
543
- } ) ;
546
+ } ;
547
+ this . sortChange . emit ( sortedColumn ) ;
548
+ this . updateSort ( sortedColumn ) ;
544
549
}
545
550
546
551
if ( this . syncWithUrl ) {
@@ -775,7 +780,7 @@ export class TableComponent
775
780
}
776
781
}
777
782
778
- interface SortedColumn {
783
+ export interface SortedColumn {
779
784
column : TableColumnConfigExtended ;
780
785
direction ?: TableSortDirection ;
781
786
}
You can’t perform that action at this time.
0 commit comments