Hi,
I want to implement search bars inside each column header where I can type to search. Thanks to this forum I got the implementation of the search fields and the search functionality itself to work perfectly (unfortunately I can’t find the reply that gave the instructions anymore but it was highly appreciated).
However, I also want to be able to toggle these search fields via double clicking of the header row and adjust the header row height accordingly (ideally with CSS animation but that is optional).
So:
- double click: show search field + expand header row height.
- double click again: hide or remove search fields and restore original header row height
I got the toggle to kind of work but I just can’t get the header row height adjusted. Here is a simple example of my current progress:
https://jsfiddle.net/41fpLosy/
(comment-in line 70 for a naive approach at changing header height)
Now I understand that the table consists of a master table and a clone that sits on top. My impression so far from fiddling with my actual project and different approaches of manipulating CSS (adding classes, using querySelector, …) is that I can get the master to adjust its header row height but I can’t get the clone to follow suit, so it stays stuck at the increased width, even after the search bar is set to display: ‘none’.
I usually figure these things out on my own sooner or later but since I don’t know the inner workings of handsontable well enough I feel stuck at this problem right now.
Can you think of a good way to solve this? Any ideas or pointers will be greatly appreciated.
Best regards