Using primereact expandable rowgroup https://primereact.org/datatable/#rowgroup_expandable works nice. But there is an evil effect when also using pagination.
The question is how to get rid of that?
Let there be 30 lines of data. let they be gouped into buckets of 3 rows each. Pagination setting shows 10 rows only.
Due to pagination there only shown 10 rows. This leads to:
page 1
'------------
row1-3 = group1
row4-6 = group2
row7-9 = group3
row10 = group 4 (rows 11 + 12 are shifted to the next page)
page 2
'---------
row1-2 = group 4
...
This is the table definition:
<DataTable value={this.state.data}
rowGroupMode="subheader" groupRowsBy="internal_id"
expandableRowGroups expandedRows={this.state.expandedRows} onRowToggle={(e) => this.setExpandedRows(e.data)}
rowGroupHeaderTemplate={headerTemplate}
reorderableColumns size="small"
paginator
paginatorTemplate="CurrentPageReport FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"
rows={25} rowsPerPageOptions={[25, 50, 100]}
header={this.headerTemplate}
filters={this.state.filters}
emptyMessage="No entry found."
>
<Column field="id" header="#" align="right" alignHeader="center" sortable></Column>
<Column field="last_name" header={this.t('last_name')} filter sortable></Column>
<Column field="first_name" header={this.t('first_name')} filter sortable></Column>
...
</DataTable>