SearchBuilder with Absolute Sorting

SearchBuilder with Absolute Sorting

trongarttrongart Posts: 222Questions: 51Answers: 0

When SearchBuilder is applied on a numerical column with some empty cells, it can filter for greater than / smaller than etc. conditions. However, when I use absolute sorting numbersType as explained https://datatables.net/plug-ins/sorting/absolute on the same column to ignore empty values when sorting, SearchBuilder seems to interpret the data as strings and can no longer apply greater than / smaller than filters. (This is the same with every sorting plugin when used with SearchBuilder.)

Is there a way to use the absolute sorting plugin with SearchBuilder and to keep the column values numerical?

This question has an accepted answers - jump to answer

Answers

  • trongarttrongart Posts: 222Questions: 51Answers: 0
    edited August 2021

    Here is an example of the issue: live.datatables.net/regizelo/1/edit

    Column Age has some empty values - The SearchBuilder sees it as string with numbersType type sorting.

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @trongart ,

    The columns.searchBuilderType initialisation option should be able to solve this, but it doesn't appear to be working when I edit your test case. Something isn't right there. I've raised an issue internally (DD-2141 for my reference) and will report back here when there is an update.

    Thanks,
    Sandy

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @trongart ,

    That should be the issue fixed now as you can see at this example. This will be available in the next SearchBuilder release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.

    Thanks,
    Sandy

  • trongarttrongart Posts: 222Questions: 51Answers: 0
    edited August 2021

    Appreciate your quick help @sandy !

Sign In or Register to comment.