searchBuilder

searchBuilder

LapointeLapointe Posts: 430Questions: 81Answers: 4

Hi @colin @sandy @allan

Is there a way to sort option list shown by searchBuilder from orthogonal values (or not) coming from an array field in the table ?

Replies

  • LapointeLapointe Posts: 430Questions: 81Answers: 4
    edited April 2021

    So I change line 2190 in dataTables.searchBuilder.js

    // original
    options.sort(function (a, b) {
        if (that.s.type === 'string' || that.s.type === 'num' || that.s.type === 'html' || that.s.type === 'html-num') {
    // changed to 
    options.sort(function (a, b) {
        if (that.s.type === 'array' || that.s.type === 'string' || that.s.type === 'num' || that.s.type === 'html' || that.s.type === 'html-num') {
    

    This work... Sure it is not perfect but waiting for better solution...

    If this solution is correct can you post searchbuilder.min.js please

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin

    Hi,

    Sandy will get back to you about this - probably on Friday which is when he is next in.

    Allan

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Very well.

    This let me time to work on column filter for array type...

    Bob

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @Lapointe ,

    Yes that is correct, thank you for letting us know. We added the array type after the others and must have missed this. I've just made the fix.

    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

This discussion has been closed.