Custom Sort - Null/Empty values at the bottom of Table for ASC or DESC

Custom Sort - Null/Empty values at the bottom of Table for ASC or DESC

jordan_josh3184jordan_josh3184 Posts: 12Questions: 5Answers: 0

Hello ,
I am trying to provide custom sort on column age and salary where there are some null/Empty values . I would like to put it always at the bottom of the data table as those are the null values. I tried using Osort custom sort by providing Type but not seeing my function is working. I have provided JSfillde link for your reference. this is dummy data so values can be integer or String.

Link to Case (JsFiddle) : **https://jsfiddle.net/jordan_josh3184/41ufrd93/11/**:
Error messages shown: There isnt any message , when i put the Osort on console i see custom Type but any how sorting isnt done correctly.

thank you

Answers

  • jordan_josh3184jordan_josh3184 Posts: 12Questions: 5Answers: 0

    Hello ,
    I am able to find solution when there is empty values how to always push them to bottom of table. now I would like to do sorting for numeric values first , then String and then empty values.. First numeric values will be sorted asc or desc in column , then String will be sortin asc or desc and then empty values.

    I have created data for Age column in jsFiddle.
    https://jsfiddle.net/jordan_josh3184/41ufrd93/33/

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    This blog post might be of interest to ensure that specific data is always at the start (or end) of the table.

    Allan

Sign In or Register to comment.