components icon indicating copy to clipboard operation
components copied to clipboard

fix(material/table): data not being re-rendered when sortingDataAccessor is changed

Open crisbeto opened this issue 6 years ago • 2 comments

Fixes the table's data not re-rendering when a new sortingDataAccessor is assigned to the data source.

Fixes #15888.

crisbeto avatar Apr 27 '19 16:04 crisbeto

@crisbeto It looks like this PR is outdated, please rebase the PR.

nvaralakshmi avatar Nov 29 '21 10:11 nvaralakshmi

I spent some time trying to get this to pass all the internal checks, but it appears to be more breaking than I was expecting. The problem is that changing the sortDataAccessor to a getter/setter causes compilation errors for apps that do something like this:

class MyDataSource extends MatTableDataSource {
  override sortDataAccessor = customSortDataAccessor;
}

I tried working around it with the defineProperty call, but it ended up causing other issues. We should discuss whether it's worth the effort to continue with this change.

crisbeto avatar Feb 28 '22 11:02 crisbeto