How to remove click event from header cell
How to remove click event from header cell
sjw01
Posts: 67Questions: 36Answers: 1
I followed this guide: https://datatables.net/examples/api/multi_filter_select.html and added dropdown search fields on 3 of my columns.
I moved the dropdowns into the header and set the default value to the cell title - Perfect.
However... There is a click event on the entire header cell. On the columns where I have added a search filter, I want to remove the click handler (BUT, I want to leave it active on the aria controls)
Is this possible?
This discussion has been closed.
Answers
Hi @sjw01 ,
You can use standard jQuery stuff for that - so something like
or you can narrow down the selector, if you want specific columns:
Cheers,
Colin
Thanks.
That takes the click off the head but also off the aria controls.
I assume I need to re-assign that click to only the aria controls which I assume is not possible given that the controls are a background image inside the cell?
Hi again,
The best bet is to have a second row in the header, something like this: http://live.datatables.net/duhahuso/1/edit
There's no easy, clean way to do it on the single row unfortunately.
Cheers,
Colin