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

RowGroup - get the ID of the child rows

$
0
0

Hello

I'm using Rowgroup for grouping the rows by the 3rd column (customer) and in my rendering of the group, I would like to retrieve the customer id.

<tr>
    <th> Order N ° </th>
    <th> Date </th>
    <th> Customer </th>
</tr>
<tr>
    <td> 300 </td>
    <td> 2021-03-21 </td>
    <td data-id="500"> Mike </td>
</tr>
<tr>
    <td> 301 </td>
    <td> 2021-03-21 </td>
    <td data-id="500"> Mike </td>
</tr>
<tr>
    <td> 302 </td>
    <td> 2021-03-21 </td>
    <td data-id="500"> Mike </td>
</tr>
<tr>
    <td> 400 </td>
    <td> 2021-03-25 </td>
    <td data-id="501"> Jason </td>
</tr>

Here is my code:

  rowGroup: {
             startRender: function (rows, group) {
var ID = rows.data().find('td').eq(3).data ("id");
return $ ('<tr />').append ('<td colspan="3">' + group + '' + ID + '</td>)
             },
       dataSrc: 2
}

But of course that doesn't work.
An idea geniuses?
Thank you


Viewing all articles
Browse latest Browse all 82458

Trending Articles



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