bogdan / datagrid

Gem to create tables grids with sortable columns and filters
MIT License
1.02k stars 115 forks source link

Allow to override the columns and filters if grid defined before that #258

Closed hipvan-nhannguyen closed 4 years ago

hipvan-nhannguyen commented 5 years ago

Issue: Sometime we want to reuse columns and filters from parent grid. It's ok if all the columns, filters on child grid has same implementation as parent grid. But if on child grid, we want to override the implementation to filter or show the data of column it will cause duplicated column

bogdan commented 5 years ago

My intuition tells me that something like this should never happen if you have your class hierarchy designed right.

I would recommend to have a SharedGrid that defines all columns and filters that are shared and several grid that inherit this one. You can also have multiple shared modules like SharedColumnsGrid, SharedFiltersGrid, SharedUserFiltersGrid etc if you need a more complex reuse system.

If you think this is impossible or inconvenient in your case, please explain me why.

bogdan commented 4 years ago

No followup, closing.