vedmack/yadcf

range_number_slider reset will omit empty values

Opened this issue · 0 comments

Not sure if this is a bug or a feature request.

(Test page: Sorry, not a public project. I'd have to see if I can come up with a minimal example if you can't reproduce this.)

I have a django application which filters float ranges for values that can also be null.

The yadcf initialisation options look like this for the respective column:

      {column_number: 7,
       filter_type: 'range_number_slider',
       data: [0.0, 10.0],
       filter_plugin_options: {step: 0.1},
       filter_delay: 1000
      },

Before I touch the sliders, the rows null values are displayed in the datatable.

Corresponding part of query looks like this:

columns[7][data]: cvss2a__e_score
columns[7][name]: 
columns[7][searchable]: true
columns[7][orderable]: true
columns[7][search][value]: 
columns[7][search][regex]: false

especially [search][value] is empty.

As soon as I select either a min or max range, the unset values disappear, which is ok (because I want to have the proper range).

Corresponding part of query looks like this:

columns[7][data]: cvss2a__e_score
columns[7][name]: 
columns[7][searchable]: true
columns[7][orderable]: true
columns[7][search][value]: 0-yadcf_delim-8.8
columns[7][search][regex]: false

Now if I click on the small x to reset the column filter to the default, I'd like to be able to see the null columns again. But instead the filter is reset to the configured min/max values and the rows with unset scores are still filtered out.

Corresponding part of query looks like this

columns[7][data]: cvss2a__e_score
columns[7][name]: 
columns[7][searchable]: true
columns[7][orderable]: true
columns[7][search][value]: 0-yadcf_delim-10
columns[7][search][regex]: false

I'd like the [search][value] to become empty again here but I see no way to configure this and I admit I don't understand what's happening in the code in rangeNumberSliderClear as opposed to addRangeNumberFilter and/or addRangeNumberAndSliderFilterCapability.