Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
Custom sort strategy not applied for sortingExpressions
posted

I have a column defined with a custom sort strategy. That is working fine when I manually sort the column. However I added sortingExpressions so that it would be sorted in first place by default. That isn't using the custom sort strategy but instead just using the default sorting strategy. I tried adding the strategy to the object passed in for sortingExpressions but its still not calling it.

I have:

this.summaryGrid.sortingExpressions = 
[{fieldName: 'formattedModifiedDate'dir: SortingDirection.Descstrategy: this.gridHelperService.stringDateSortStrategy}];
and column definition
<igx-column field="formattedModifiedDate" header="Modified Date" width="160" [sortStrategy]="gridHelperService.stringDateSortStrategy"></igx-column>
               
The sorting is applied to the column by using sortingExpressions just the order is wrong and by debug I can see it never calls to my stringDateSortStrategy. When I click the column header for sorting it works properly and my sort is called.

How can I use my custom sort strategy with the sortingExpressions?

Thanks