Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82528

Column sorting breaks when I use jquery to add a second header row

$
0
0

I'm trying to create a table with a double header row and dynamically configured columns. Because of the latter requirement I can't create the table headers statically in the page and then just provide data via javascript.

I can create the bottom row of headers by passing suitable column data into the DataTable() call, but have am using javascript to create the html for the top row and then inject it into the table header. When I do that though, it breaks sorting. The sort arrows are still shown but don't function.

I have a fiddle with a stripped down example of what I'm trying to do:

https://jsfiddle.net/q0cv296a/


Viewing all articles
Browse latest Browse all 82528


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>