Matblazor: MatTable changes

Created on 1 Aug 2019  路  9Comments  路  Source: SamProf/MatBlazor

Hi All,

I just want to leave a general comment on the MatTable component. I suggest to remove all paging and data loading functionality from the component and make it super dumb, its only job would be to render the table and route user interactions to the hosting component.

I think it would be much better if:

  • Pagination would be a different component. It's job would only be to fire events when the pagination has been changed by the user and it would be the hosting component's responsibility to handle pagination -> loading the new page and passing the new list to the MatTable component for rendering. The hosting component could decide that client side or server side paging is used.
  • Same can be done with filtering. Remove it from MatTable completely.
  • Remove data loading using the provided ApiUrl parameter completely. Let the hosting component handle loading, paging, filtering on the client side, or call the proper APIs if server side paging is in use.
  • Sorting should be work like paging. When sorting changed by the user an event should be fired and the hosting component could handle the sorting request.

It might be too much, but I think these changes would improve the usability of the MatTable component.

Most helpful comment

MatTable needs to be changed a lot.
And also, an architecture should be created to modify and add functionality in the future.

I will soon collect all requests for MatTable and think over my view of MatTable.

All 9 comments

@gprokay I started MatTable based off another repo, and yes what you are proposing is something that has crossed my mind. After all this is how material angular Data Table is done. I definitely see the benefits of decoupling those components. Would you be willing to do the work on submitting the PR for this?

I completely agree with @gprokay . MatTable

MatTable needs to be changed a lot.
And also, an architecture should be created to modify and add functionality in the future.

I will soon collect all requests for MatTable and think over my view of MatTable.

I think there is use for a basic "table like" control that just renders a flat table, but i also believe it would be useful to have a more complex "grid like" control that would handle paging and filtering. It saves A LOT of redundant boiler plate code if i can just pass it a list of objects and all of that is handled by default (assuming I enabled those options). The current implementation falls right in between the two.

That said, having it filter on only a single column is a bit limiting. Just my $.02s.

Hi Any Updates on this?

I wanna do server side paging, not able to do it with current mat-table.

Hi Any Updates on this?

New MatTable will be in near February

Hello. Any news on this? Maybe i can provide some help if it's needed.

@SonicGD ,
We welcome contributions to the repo. We need more folks to contribute.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rogeralsing picture rogeralsing  路  5Comments

sowsan picture sowsan  路  3Comments

JeroMiya picture JeroMiya  路  6Comments

daviderusso1984 picture daviderusso1984  路  6Comments

kristof12345 picture kristof12345  路  5Comments