yadcf icon indicating copy to clipboard operation
yadcf copied to clipboard

clear filter when using date_custom_func leaves last filtered date supplied to custom_func

Open louking opened this issue 3 years ago • 0 comments

test case: https://jsbin.com/cixawez/edit?html,js,output

steps to cause problem:

  • pick a filter date which limits display
  • click x to filter
  • previous filtered set remains

also ref: https://stackoverflow.com/questions/65460395/yadcf-clear-filter-when-using-date-custom-func-still-causes-last-date-to-be-supp

I have a table with start and finish dates in the rows, and I want to create a date filter which chooses rows for which the date in the filter is between the start and finish dates. The start or finish dates might be empty which means "unspecified" so the range is open on that side of the start/finish span.

I messed around with range date on the two columns but wasn't able to get that to work, and decided the best solution was probably to use the date_custom_func. This works for the most part, but seems like clearing the date in the filter causes the filterVal in the custom_func to be passed the last value of the filter rather than ''.

louking avatar Dec 30 '20 11:12 louking