Concerning the jquery datatables rowgrouping plugin: http://jquery-datatables-row-grouping.googlecode.com/svn/trunk/index.html , is it possible to have the two-level grouping and also have both groupings expandable / collapsible? I couldn’t find anything on the site mentioning this.. wondering if any has tried it
Concerning the jquery datatables rowgrouping plugin: http://jquery-datatables-row-grouping.googlecode.com/svn/trunk/index.html , is it possible to have the
Share
I didn’t see anything either about the plugin doing this. I think the most efficient solution (in terms of runtime) would be to modify the rowGrouping plugin itself, but that might get complicated every time the creator updates the plugin (and to the best of my knowledge, it’s not really possible to extend a jQuery plugin).
Anyway, I came up with a solution. It’s not pretty and could stand to use a lot of improvement, but hopefully it serves to spark some ideas at the very least. Basically I created my own jQuery plugin that wraps the rowGrouping plugin (you could also just use the middle part by itself – see notes in code). It instantiates a rowGrouping dataTable then traverses the rows looking for subgroup rows within each major group. Then it finds rows under each subgroup and assigns them a class unique to that group/subgroup combination. Finally, it uses this class as a selector to toggle the rows when a subgroup row is clicked.
And here’s how you would use it:
Hope this helps. Cheers.