What I want to do is to sort the data already grouped in alphabetical order or custom order. I used the sortField attribute which specify the groupheader order but
For those who have the problem with TurboTable , here is the solution:
OnSort() implementation:
onSort() {
// function to properly work with turbotable and rowgroup, see: https://www.primefaces.org/primeng/#/table/rowgroup
this.updateRowGroupMetaData();
}
customSort() implementation:
customSort(e) {
this.budgets.sort((a, b) => {
const aGroup = a.name.toLowerCase();
const bGroup = b.name.toLowerCase();
if (aGroup > bGroup) { return 1; }
if (aGroup < bGroup) { return -1; }
const aSort = a.color;
const bSort = b.color;
if (aSort > bSort) { return 1; }
if (aSort < bSort) { return -1; }
return 0;
});
}