Closed vmia159 closed 1 year ago
Can I ask a more general question first, why would you use classes for data storage?
You can implement function in class for complex display logic. And in case server make changes to the property names, you can just correct the constructor instead of find out every places you have used the data.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.
If we pass in a class array as data, the function cannot be used in columns render.
Let say if we have a class like this. We cannot use testFunction in render
This is because the current implementation on data-manager.js setData use spread operator to add tableData to the rowData https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#spread_in_object_literals
To fix this, use Object.assign instead
I am not going to give a pr because @material-table/core are refactoring and removing data-manger.js To work around this without updating @material-table/core