ng-matero / extensions

Angular Material Extensions Library.
https://ng-matero.github.io/extensions/
MIT License
393 stars 48 forks source link

mtx-grid sorting with "complex" field seems doesn't work #243

Closed SYS64738 closed 6 months ago

SYS64738 commented 8 months ago

hi, when I have a field that refers a subfield in a complex object, data are shown fine, but sorting on column seems doesn't work.

this is an example of configuration:

image

thank you, have a nice day

nzbin commented 8 months ago

What is your data structure?

SYS64738 commented 8 months ago

this is the main object (I pass an array of this kind of objects to mtx-grid data)

image

the Family object looks like:

image

nzbin commented 8 months ago

I'm sorry, the sort doesn't support nested object. Maybe you can try to customize the sortingDataAccessor https://github.com/ng-matero/extensions/discussions/135

SYS64738 commented 8 months ago

I tried to use sortingDataAccessor, without success... the strange behavior I noticed is: if I sort the grid by any "non-nested" object, then (only the first time) sort works even with any other nested object; this behavior occurs even if I don't use sortingDataAccessor, it occurs always...