Posted 29 October 2021, 4:26 am EST - Updated 3 October 2022, 3:16 am EST
I have a common component which has a collection to be displayed with descending order (latest on top).
Also if there is no date in an array of objets that should be on top of the latest date. Using angular 6+ and wijmo flexgrid.
This collection is part of 2, 3 pages and we are using the collection and data will be passed from the place where we use this component which has dates
Ex : Could you suggest me a case where one of the object doesn’t have a date and it needs to be on top and the rest of them should be in descending order. My scenario is for one row not having a date and it should be on top and rest of them needs to be in descending order.
This common collection I will be using in multiple components where we populate data from server in parent component like below
parent.ts
this.dataGridCV = new wjcCore.CollectionView((res.data));
parent.html as below
<data-grid [dataGridCV]=“dataGridCV” >
</parent component>
Common component html is as below :
<wj-flex-grid-column [header]=“‘Stream’” [binding]=“‘streamCount’” width=“" align=“left”>
<ng-template wjFlexGridCellTemplate [cellType]=“‘Cell’” let-item=“item”>
<a href [routerLink]=“item.links.stream” queryParamsHandling=“merge”>Documents({{item.streamCount}})
<wj-flex-grid-column [header]=“‘date’” [binding]=“‘startdate’” width="” align=“left”>
<ng-template wjFlexGridCellTemplate [cellType]=“‘Cell’” let-item=“item”>
{{item.startdate| date: startDateFormat}}
Empty date should be at top and other dates should be in descending order. But I am not able to do that. Attached my example here