How to not use "no group" in the extension rowGroup?
How to not use "no group" in the extension rowGroup?
Some of my rows have groupings (in my case they are like child entries of the parent), but some dont. I would like those that do have row groupings to be grouped, but those that dont, dont. Just have them as normal rows ungrouped, and be ordered within the same sorting as the groups. So I would only see the groupings for those with child entries.
So it would be like this:
Element 1
- Element 1 Child 1
- Element 1 Child 2
- Element 1 Child 3
Element 2
Element 3
- Element 3 Child 1
- Element 3 Child 2
Thanks
Answers
Hi @amityweb ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
I know this is from last year, but I have the same issue with rowGroup. not sure if youve managed to get what your suggesting working with rowGroup. I have resolved it with the following code I found somewhere;
To make sure we are talking about the same thing, you mean you want anything were group is empty or null to not be grouped under a heading? rowGroup doesnt seem to support this whereas the above code does. My preference would be to use rowGroup.
Found this in documentation;
This doesnt work for me. I have version 1.1.0 of rowGroup. Im getting js error, that cant be found, if the value is set to null. Guess i must be doing something wrong. Here is my code when using rowGroup;
The only way I can get the above code to work, when the segment_title is null, is to do the following;
return row.pg.segment_title === null ? "Not Categorised": row.pg.segment_title;
This is the error message I get when the value returned in dataSrc is null
it seems to work here with
null
data.http://live.datatables.net/zoquhemu/1/edit
You can try with
dataSrc
as a function or directly assigning the column. It produces the same result.Maybe you can update the test case to replicate your issue. Or provide a link to your page.
Kevin