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

rowGroup multi level group startRender question

$
0
0

Hi,

First post here on datatables forum. Love the product, real game changer for my team at work. Anyway, on to my question.

I'm working on a table whereby i am using extension rowGroup with multi level grouping and activating it like so
dataSrc: ["PayrollNo", function (row) {
return moment(row.ExtraDutyFrom).format("DD/MM/YYYY")
}

What i wanted to do was insert some counts of data only into the 2nd group headings, which i found something similar what i wanted here - https://datatables.net/reference/option/rowGroup.startRender

startRender: function ( rows, group ) {
return group +' ('+rows.count()+' rows)';
}

but this puts the count in both the 'PayrollNo' heading and also the date heading. I note the description for startRender says 'The function defined by this option will be called once for every group shown in the DataTables', which i why i get the counts in both headings.
In my case i only want this to run on my second data source (the date returned by the moment function above).

So my question, is it possible to only do the count option on the 2nd group? Secondly, is it then possible to hide any rows on the table whose count returns less than 2?

I'm not in a position to post an example just yet as per forum rules as its only a question of is it possible (however if you want one i'll certainly do the necessary).

Any help appreciated :-)
Thanks.


Viewing all articles
Browse latest Browse all 82710

Trending Articles



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