Column filter in cloned header.
Column filter in cloned header.
Link to test case: https://live.datatables.net/vetuhule/8/edit?js,console,output
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
I've recently updated from datatables 1.10 to 2. For column filtering I have cloned the header and used orderCellsTop to prevent it from sorting when clicked.
Now with version 2 I see that orderCellsTop is deprecated and the alternative is using data-dt-order="disable"
, however for some reason the api columns()
returns the cloned column instead of the original. In the linked test case you can see a very simple representation of the problem, if you replace the .attr('data-dt-order', 'disable')
with orderCellsTop: true
it will work as intended.
This question has an accepted answers - jump to answer
Answers
personally I would continue using
orderCellsTop
if it works in my solution. @allan has this comment in this thread.You may need to make changes at some point if its removed. Hopefully we can talk Allan into keeping the option. I find it useful at times too.
You can control the row the
column().title()
fetches the title from by passing in therow
parameter. Updated test case showing this:https://live.datatables.net/vetuhule/14/edit
Kevin
That will do it, thanks for the help.