daniel-nagy / md-data-table

Material Design Data Table for Angular Material
MIT License
1.9k stars 520 forks source link

null values sort as "null" #577

Open mapsandapps opened 7 years ago

mapsandapps commented 7 years ago

Null values sort as if they were the string "null" instead of being pushed to the top/bottom of the sort order.

Here's a codepen reproducing the issue.

ghost commented 6 years ago

To avoid it, I "clean" the data list of objects on loading, removing each property which have value null.

Here's same codepen reproducing the solution removing "null properties".

ckosidow commented 4 years ago

This applies to undefined and non-existent fields injected with Angular expressions. It would be nice if these rows moved to the end of the table regardless of direction. I have a large table with a lot of non-existent cells. Sorting by descending is pretty useless for this use case.