Modify sort behavior column header to only trigger sorting when I click on the header name
Modify sort behavior column header to only trigger sorting when I click on the header name

Hi all, hope you are doing great, currently the behavior of the data tables when sorting expands the whole column and I only want it to take effect only when I click on the header name not the area around it, is there any configuration to achieve this?
see the image below for what I want to achieve.
This discussion has been closed.
Answers
There isn't a built in option for that at the moment I'm afraid.
The workaround would be to add a
span
around the text and unbind the DataTables sort listener from theth
, then bind a new one to the newspan
usingorder.listener()
.Allan