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

MtrevorMtrevor Posts: 1Questions: 1Answers: 0
edited November 2022 in Free community support

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.

Answers

  • allanallan Posts: 57,700Questions: 1Answers: 9,195 Site admin

    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 the th, then bind a new one to the new span using order.listener().

    Allan

Sign In or Register to comment.