I have not seen anything about the plugin doing this. I think that the most effective solution (in terms of runtime) would be to modify the rowGrouping plugin itself, but this can be complicated every time the creator updates the plugin (and, as far as I know, it is actually impossible to extend the jQuery plugin).
Anyway, I came up with a solution. It's ugly and can cost a lot of improvements, but hopefully it at least arouses some ideas. I basically created my own jQuery plugin that wraps the rowGrouping plugin (you can also just use the middle part separately - see the notes in the code). It creates an instance of rowGrouping dataTable, then crosses the rows that look for the rows of the subgroups in each main group. He then finds the lines under each subgroup and assigns them a class unique to that group / subgroup. Finally, he uses this class as a selector to switch rows when clicking on a row in a subgroup.
And here is how you use it:
$(function() { var oTable = $('#example').dataTable({ "bLengthChange": false, "bPaginate": false}).rowGroupingWithColapsableSecondLevel({ "iGroupingColumnIndex2": 1 , "bExpandableGrouping": true }); });
Hope this helps. Greetings.
source share