cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

sap.ui.table.Table - Sorting columns by avoiding rows with blank values through Standard ?

SAPSeeker
Participant
0 Likes
930

Hi Experts,

I am trying to sort a table column that have blank values in few rows. Standard sorting functionality considers those blank values as well and brings those rows to top while sorting ascending.

Is there a possibility to sort columns only based on values present by skipping those blank value column rows through standard way ? If yes, can you help by pointing how to achieve ?

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Bernard
Participant
0 Likes

You can create your own sorter

var oSorter = new Sorter( ... )

You can then create your own oSorter.fnCompare function where you set empty strings to be of "high value" relative to other strings. This will place them at the bottom (as opposed to the top)

If you want to eliminate the blank values altogether you can cast your current object list to one where blanks are ignored.

SAPSeeker
Participant
0 Likes

Is there a way to do it without creating own sorter by introducing code (ie through property of column/table), which might be more helpful ? thank you.

Bernard
Participant
0 Likes

The default sorter works in a standard way - I am not aware of how you would do this without either adjusting your data or overriding the standard sorter.