Individual column searching
Individual column searching
Hello, I've created a plug in which wraps the individual column searching features described here and here.
The plug in allows the search inputs to placed in a second header row, which works perfectly unless scrollY is enabled. With the scrollY value set, the search header row is contained within the scroll body, instead of maintaining its position with the sort header row.
Example: http://live.datatables.net/pakocefu/1/edit?html,js,output
Is this a bug or am I doing something wrong?
This question has accepted answers - jump to:
Answers
Looks great - thanks for sharing the code with us.
To get the
thead
element for the table regardless of scrolling ustable().header()
.The reason for that is that the table is split into its component parts when scrolling is enabled to allow the body to scroll independently of the header and footer.
Allan
That works Thank you , Allan.
Could you offer a suggestion for the best way to update each select when the table data changes? i.e. after rows added / removed. I was thinking draw event, but this could be fired for reasons other than data changing? Thanks
I wrote an example of that a while back, which is available here: http://live.datatables.net/gejojiqu/1/edit .
Allan
Thanks so much. Works perfectly!