how to disable click (on column header) event of data sorting but still keep ordering functions?
how to disable click (on column header) event of data sorting but still keep ordering functions?

Description of problem:
I need to add a click event to column headers for a menu popup, without doing data sorting. The sorting will be done somewhere else in the page. If I use ordering: false
, it stops the click event on column headers, but it also stops the functionality of column().order()
that needed from other event listeners.
Thanks for your help!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
There are a couple options:
orderCellsTop
to place ordering in the top row and your click event for the menu pop up in the second row.columns.orderable
to turn off the click events but still be ale to order viaorder()
andorder
.Kevin
Answer:
This piece of code
orderable: false
, solved the problem. Details at following link https://datatables.net/reference/option/columnDefs.targets