PrimeNG DataTable does not allow grouping and sorting together

I am using PrimeNG DataTable ( http://www.primefaces.org/primeng/#/datatable ). I defined one of the columns to sort (). This worked great until I wanted to group the headers using a group approach.

this.headerRows = [
    {
        columns: [
            {header: 'Station Data', colspan: 3}
        ]
    },
    {
        columns: [
            {header: 'ID'},
            {header: 'Name'},
            {header: 'Basin'}           
        ]
    }
];



     <p-dataTable [value]="stationsArray" [headerRows]="headerRows" [globalFilter]="gb" [rows]="3" [paginator]="true" [rowsPerPageOptions]="[3,5,7]" scrollWidth="100%" >  
            <!-- ID -->
            <p-column field="id" [sortable]="true"></p-column>
            <p-column field="name" [sortable]="true"></p-column>
     </p-dataTable>

At this point, the sorted column stops showing the sort indicator. Can they not be used together? grouped heading image

+4
source share

Source: https://habr.com/ru/post/1650735/


All Articles