I used to sort my igx-grid like so:
this.grid.sortingExpressions = [ {fieldName: 'name', dir: SortingDirection.Asc, ignoreCase: true} ];
but after the last update I'm getting an error that I'm missing the strategy property. It looks like it's a dictionary...what am I supposed to put here?
Hello Scott,
Thank you for the code-snippet you have provided.
After the update, in order to set the sortingExpressions, you will have to include a sorting strategy object for each sorting expression. If you are not using any custom sorting strategy, you can update your code as follows:
this.grid.sortingExpressions = [ {fieldName: 'name', dir: SortingDirection.Asc, ignoreCase: true, strategy: DefaultSortingStrategy.instance()} ];
For more details on this change, you can refer to the General section of version 6.1.9 in the changelog.
If you have any questions, please let me know.
Instead of making a breaking code change, why not make the default strategy that to begin with?
In Ignite UI for Angular 6.2.3 and 7.0.2 the sorting strategy and the ignoreCase will be implemented as optional and will no longer need to be explicitly defined.
You can refer to the respective PRs for more details:https://github.com/IgniteUI/igniteui-angular/pull/3241https://github.com/IgniteUI/igniteui-angular/pull/3242
The sortingExpressions property is currently of ISortingExpression array interface type and it should be assigned an array of objects that implement this interface. When custom sorting is executed through the API, for every sorting expression we have to implement each property that is defined in the interface, which includes the sorting strategy.
For more details on the current functionality and the behavior of the IgxGrid in regards to the sorting, you can always go ahead and take a look at the discussions on our Ignite UI for Angular community on github. https://github.com/IgniteUI/igniteui-angular