Reputation: 5
In my code i need to use ngx-datatable. The row data is in key value pairs but value is of type object. Now the default sorting is not working. In case of angular Mat-Table its dataSource has a property called sortingDataAccessor which specifies the data with which the objects is to be sorted as objects cant be sorted. Does ngx-dataTable has any such functionality? If no, is there any workaround for that. As sorting is very much needed.
tableData format [{row11:{xxx:yyy,aaa:bbb},row12:{xxx:yyy,aaa:bbb}}]
Thank you. Please help guys..
Upvotes: 0
Views: 1061
Reputation: 665
There is a custom Comparator available in ngx-datatable please refer to their exaple https://swimlane.github.io/ngx-datatable/#comparator-sorting
With this you can sort according to your need.
Upvotes: 1