Okay
  Public Ticket #3189582
Number Range Slider Broken
Closed

Comments

  • Brett Stocker started the conversation

    I currently have a table generated from a JSON file. When I configure one of the columns to have a Float data type and Number Range filter type, everything works fine. But if I also enable the 'Number Range Slider' I get the following error.

    load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.1.1:2 
    Uncaught Error: noUiSlider (11.1.0): 'range' value isn't numeric.
        at B (bootstrap-nouislider.min.js?ver=5.1:3:2870)
        at new D (bootstrap-nouislider.min.js?ver=5.1:3:3630)
        at Object.G [as t] (bootstrap-nouislider.min.js?ver=5.1:3:4209)
        at bootstrap-nouislider.min.js?ver=5.1:3:9503
        at Array.forEach (<anonymous>)
        at X (bootstrap-nouislider.min.js?ver=5.1:3:9371)
        at Object.Z [as create] (bootstrap-nouislider.min.js?ver=5.1:3:20761)
        at wdtCreateNumberRangeInput (wdt.columnFilter.js?ver=5.1:365:24)
        at Object.<anonymous> (wdt.columnFilter.js?ver=5.1:76:29)
        at Function.each (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.1.1:2:3003)</anonymous></anonymous>
    


    I have noticed that this only happens when I have cells in this column that are empty. If I insert a value for these cells then the error goes away and the range slider works as expected. So it seems like there is a bug with interpreting empty values when building the range slider.

    Is this a known bug or is there a way to avoid this issue?

  • Brett Stocker replied

    I have just noticed that if I enter anything in the 'empty' cells then the range slider works and does not crash. By anything I mean even a simple space character avoids this crash for some reason. When I do this the backend converts this single space value into a numerical 0 which is displayed in the cell.


    Kind of frustrating I can't just leave the cell completely blank instead and still have this same functionality.

  •  1,850
    Miloš replied

    Hi, Brett

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    -

    You are correct. Currently, there is a limitation with the "Number range slider", for presenting NULL/blank values.

    If we use blank/NULL values in cells,

    a "Number Range" filter can work OK with that,  but a  "Number range Slider"  can not work with this data,  and that is why it was making those errors.

    - Our devs plan to work on improving this behaviour, but i can't say a realistic ETA if or when it might be changed.

    Perhaps a workaround for this use-case  might be to set the original value in the cells to 0,

    but then to use Conditional Formatting on the column to present these 0 values as "NULL"/blank for the final user.

    Then you will be able to use a Number Range filter, and the Number Range Slider if you need it.

    Here is my example - if i have this Test Numeric Column, and i put zeroes, where all the NULLS should be

    1051627808.png

    Then i add a Number Range, with a Slider to Filtering of the column;

    but i add this Rule in the column settings/Conditional formatting:

    7256481575.png

    This will set the cell content to empty, wherever it finds zeroes :

    3161151826.png

    Now, the only "setback"  in this workaround is,

    we can't pass Conditional formatted values / or any calculated values from a table to a chart.

    So if you plan to make charts out of this table, the chart would present these values as zeroes.

    But if you don't need charts from these kind of tables, then this might work.

    Let me know how that seems. Thanks

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables