angular4-material-table icon indicating copy to clipboard operation
angular4-material-table copied to clipboard

TableDataSource should extend MatTableDataSource instead of DataSource

Open MarcoLasticot opened this issue 6 years ago • 6 comments

Hi irossimoline,

First of all, what you've developed is very cool and useful. I think it could even be better with few changes. TableDataSource should extend MatTableDataSource instead of DataSource. Like that, TableDataSource would inherited the filter and sort methods which are provided OOTB by Material.

MarcoLasticot avatar Jun 25 '18 09:06 MarcoLasticot

Hi @MarcoLasticot,

I think it could be done with a kind of big refactoring, but to keep being backwards compatible we must consider:

  • Do not enforce to depend on @angular/material package. It could be present, or it couldn't, and should be OK.
  • Keep extending DataSource, and have another structure that extends MatTableDataSource (again, backwards compatibility).
  • On the code used, try to share the most amount of code posible between both structures.
  • Recheck CRUD implementation to validate that filter and sort methods don't interfere with current implementation. Regarding this specific point, I think it would create some issues, because we are currently handling everything with the index in the array, but that value won't be a source of truth anymore using filter/sorting. We should provide a way to specify which is/are the key(s) in the list object's type provided to the list, and then modify the code to use that key.

This would require a quite big amount of work, I'm not sure I could tackle it soon. Anyway, if someone want to help with it, it would be appreciated.

irossimoline avatar Jun 29 '18 16:06 irossimoline

Hey guys! Was there any advance with this issue?

rosostolato avatar Feb 01 '19 10:02 rosostolato

Hi guys, I'm using your library and it has been very useful so far. The only thing missing is that I can't use sort and filter functionalities, and I really need it. Thanks for all the hard work so far :-)

golshidb93 avatar Apr 10 '19 10:04 golshidb93

He @irossimoline , I'd be willing to help taking into account backwards compatibility. But I'd like to do it together since you're the author. Maybe we can set up a feature branch or something?

boazhuisman avatar May 07 '19 08:05 boazhuisman

Hi @boazhuisman, sure I would love a solution that takes backwards compatibility into account.

I've created a branch named feature/allow-extend-material-table and added you as a collaborator, so you can start from there.

I don't have much available time right now, but please mention me anywhere you need extra help and I'll be willing to help you.

irossimoline avatar May 12 '19 15:05 irossimoline

Any update on this issue

rohini007 avatar Aug 19 '19 14:08 rohini007