Need to clear dynamically created column filters on button click

Tags: #<Tag:0x00007f8b2b172088>

Hi,

In our application, we are using custom column filters which is taken from this link https://handsontable.com/docs/column-filter/#column-filter

But we found that the typed filter input value is not getting cleared on doing CRUD operations. We had to manually clear the values.

So i tried to capture the typed input value in the filter box and clear it out. But, i am unable to get the value which we type in. I have created a jsfiddle code with clear button.

Is there a workaround to clear the typed in filter values on the clear button click?

Please find the demo code here, https://jsfiddle.net/nd3jzpqu/10/

Thanks,
Karthikeyan

Hi @kvengadachalam

Indeed there is some issue regarding selecting the input element value. I tried all of the possible selectors and method and nothing works. I’ll have to investigate that deeper. I’ll get back to you after the weekend.

1 Like

Thanks Adrian. We look forward for your views on this issue.

Hi @kvengadachalam

I have good news. I manage to solve this issue. However, it seems that getting the input element is impossible for some reason, I have to put the logic inside the afterGetColHeader method. To do that I moved the logic of your addInput function inside that method. I also added the logic for resetting the filtering when you clear the input values. I hope that this solution will work for you:

https://jsfiddle.net/aszymanski/yvzscqna/

1 Like

Thank you Adrian. This is great. We will try this out in our application.