DataTables 2.0.1 Header second row filter inputs overridden
DataTables 2.0.1 Header second row filter inputs overridden
https://live.datatables.net/gegihiqi/1/edit?html,js,output
I'm roughly following https://datatables.net/examples/api/multi_filter.html to add per column search input filters, and they are not displaying correctly in 2.0.1 vs 1.13.11
I'm dynamically sending the columns and data, so the <table>
completely is empty initially. I'm using orderCellsTop
as well since there are two header rows.
In 1.13.11 the search inputs show up correctly, see here: https://live.datatables.net/rigoxiqa/1/edit?html,js,output
In 2.0.1 It's overriding both header rows and just putting the title in the second row.
I see orderCellsTop
is deprecated in 2.0.0, but it should still be working right?
Is there a workaround for this?
This question has an accepted answers - jump to answer
Answers
Interesting one! Yes, the workaround is to not set
columns.title
. You are creating the header cells, so the quick way to address this is to just use a different property name: https://live.datatables.net/gegihiqi/2/edit .I'll have a bit more of a think about that, and setting the title with multiple rows...
Allan
@allan can explain the reasoning for the
orderCellsTop
deprecation. Seems like it would still be useful for this application.I think you will want to apply the search inputs to the second header row after Datatables initialization, like this:
https://live.datatables.net/jumunene/1/edit
Kevin
Thanks! I renamed the title property and it's working as expected now.