Sort DataTables with multiply -Tags
Sort DataTables with multiply -Tags
Tranduil
Posts: 2Questions: 1Answers: 0
I got a table with multiply <tbody>-Tags and I wanted to know if there is an option to only sort one specific <tbody>-Tag of the Table.
I found this thread form 2016 where it is stated that it does'nt work at the moment but may be added in the future. Is there any new Information on that?
https://datatables.net/forums/discussion/36037/can-we-sort-the-table-with-muliplt-tbody
This question has an accepted answers - jump to answer
Answers
The HTML docs still specifies that Datatables supports only one
tbody
tag.Kevin
Well, unlucky. Thanks nonetheless!
The workaround that I used was: I wrote the second <tbody> content inside a second <tr>-Tag of the table header and set "bSortCellsTop": true so that the top row is sorted.
That does a similar Job for what I wanted.
Nice workaround.
The only reason I can really think of adding support for multiple
tbody
tags to DataTables would be for some kind of row grouping, but we can already do that with a singletbody
and the relevant data, and it supports multi-level grouping, which multipletbody
's would not.Happy to get feedback on use cases for multiple
tbody
elements though.Allan
Hi, I am trying to use the table with Vue3.
I am trying to create a child for each row which expands on click. I am aware of the row.child() method but that doesn't seem to work with customized Vue component. So I created my own grouping:
Which of course messed up the whole filter and pagination. Is there any workaround on that? Thanks.