Posted 7 July 2025, 2:38 pm EST - Updated 7 July 2025, 2:48 pm EST
Hi team,
I’m using wj-flex-grid in my Angular app and trying to enable sorting on two date columns: creationDate and lastModifiedDate. Despite setting [allowSorting]=“true” on both columns, clicking the column headers does not sort the data in ascending or descending order.
HTML
<wj-flex-grid [itemsSource]="state.gridData$ | async" [selectionMode]="'None'" headersVisibility="Column">
<wj-flex-grid-column [binding]="'creationDate'" header="Creation Date" [width]="'*'" [allowSorting]="true">
<ng-template wjFlexGridCellTemplate [cellType]="'ColumnHeader'" let-cell="cell">
<div>{{ cell.col.header }}</div>
</ng-template>
<ng-template wjFlexGridCellTemplate cellType="Cell" let-item="item">
<div>{{ item.creationDate }}</div>
</ng-template>
</wj-flex-grid-column>
<wj-flex-grid-column [binding]="'lastModifiedDate'" header="Last Modified Date" [width]="'*'" [allowSorting]="true">
<ng-template wjFlexGridCellTemplate [cellType]="'ColumnHeader'" let-cell="cell">
<div>{{ cell.col.header }}</div>
</ng-template>
<ng-template wjFlexGridCellTemplate cellType="Cell" let-item="item">
<div>{{ item.lastModifiedDate }}</div>
</ng-template>
</wj-flex-grid-column>
</wj-flex-grid>
The data for these columns is in string format like 7/725 11.52AM’.
Can add date for eg
[{creationDate: '2025/4/12 2:20:00',
lastModifiedDate: '2025/4/12 2:20:00},{ creationDate: '2025/4/12 2:20:00',
lastModifiedDate: '2025/4/12 2:20:00'}]
please give the sample answer in stack blitz in angular so that we can rectify above issue.
Please find the attached screenshot for the reference.