Wanted to share as I think I’ve finally got this working. I have ColumnSorting, Filtering, and FixedRowsBottom enabled in a given table. I’ve applied the suggested code in both afterFilter and afterColumnSort to keep the fixed row in place. Both work perfectly… by themselves. When you combine filtering and sorting on a given column, some weirdness happens that breaks the fixed row.
As an example, let’s look at this jsfiddle.
First column has some text values and the bottom row (with all the 999s) is the fixed row. If you sort that first column ascending or descending, no issue. If you refresh the fiddle and filter that first column, add more filters, then remove all the filters, no issue.
However, if you combine the sorting and filtering, you can see an issue. For example, filter the first column by removing the Panda option. Then sort the column in ascending order by clicking the header one time. Then remove the filtering by adding Panda back in. You will notice that the fixed row is no longer at the bottom.
I noticed that if i executed any subsequent sort or filter, the existing logic will fix the issue and put the row back where it belongs at the bottom.
With this in mind, i added code into the afterFilter to force a sort.
const columnsorting = this.getPlugin('columnSorting');
const sortconfig = columnsorting.getSortConfig();
columnsorting.sort(sortconfig);
With this code in place, i have not been able to reproduce the issue and all combinations of sorting / filtering work without breaking the fixed row.
Thoughts on if this is an acceptable solution?