4

Recently I was use angular smart-table. The st-sort works fine except one thing: when the sort field contains empty value, it place the empty value in the middle of the sort between n and m. How can I make the empty value always at the bottom when sorting?

Haroen Viaene
  • 1,329
  • 18
  • 33
Stephanie Yang
  • 252
  • 1
  • 4
  • 13

1 Answers1

4

It's a bug (IMO) with smart-table and treating null, undefined, and empty strings inconsistently when sorting. null values are converted to their string representation of 'null' and then sorted, hence why they always get placed between n and m.

I've logged an issue: https://github.com/lorenzofox3/Smart-Table/issues/669

And repro plunkr:

http://plnkr.co/edit/BEBdzWI44z3BiIxRRDET?p=preview

Tyson
  • 14,726
  • 6
  • 31
  • 43