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
307307 @Output ( )
308308 public readonly columnConfigsChange : EventEmitter < TableColumnConfig [ ] > = new EventEmitter < TableColumnConfig [ ] > ( ) ;
309309
310+ @Output ( )
311+ public readonly sortChange : EventEmitter < SortedColumn > = new EventEmitter < SortedColumn > ( ) ;
312+
310313 @ViewChild ( PaginatorComponent )
311314 public paginator ?: PaginatorComponent ;
312315
@@ -537,10 +540,12 @@ export class TableComponent
537540
538541 public onSortChange ( direction : TableSortDirection , columnConfig : TableColumnConfigExtended ) : void {
539542 if ( TableCdkColumnUtil . isColumnSortable ( columnConfig ) ) {
540- this . updateSort ( {
543+ const sortedColumn : SortedColumn = {
541544 column : columnConfig ,
542545 direction : direction
543- } ) ;
546+ } ;
547+ this . sortChange . emit ( sortedColumn ) ;
548+ this . updateSort ( sortedColumn ) ;
544549 }
545550
546551 if ( this . syncWithUrl ) {
@@ -775,7 +780,7 @@ export class TableComponent
775780 }
776781}
777782
778- interface SortedColumn {
783+ export interface SortedColumn {
779784 column : TableColumnConfigExtended ;
780785 direction ?: TableSortDirection ;
781786}
You can’t perform that action at this time.
0 commit comments