Components: Md-Table: Possibilty to add filter fields to a table

Created on 14 Jul 2017  路  7Comments  路  Source: angular/components

Bug, feature request, or proposal:

Feature

What is the expected behavior?

I want the possiblity to add fields to the md-table to filter by user Input the table

What is the current behavior?

I can sort a md-table but don't filter it

What is the use-case or motivation for changing an existing behavior?

If there are many entries in a table with multiple pages, the filter redruce the effort to find a speficic entry

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Is there anything else we should know?

All 7 comments

What about the first example here?

https://material.angular.io/components/table/examples

The philosophy here is that features like this (selection, sorting, pagination, drag-drop) don't fall under the responsibility of the table. The table only cares about rendering rows of cells. What goes inside those cells is up to the user.

We do plan on adding a "simple table" that has these things baked into it, but suspect that most people will want the customization of the cdk-table or md-table.

Additionally, we consider filtering to have no universal enough interface to build any kind of filter component into Angular Material directly.

@jelbourn i agree that filtering is up to the user, but how does the table yet support to have a second custom header-row where i can place filters for each column ?

for me it seems that cdk-table is not as flexible as promised

@nickwinger Have you considered creating a separate header cell component that has a filter below its text? I imagine this would be fairly simple to do and would avoid having to create an additional interface for a second header row that happens to match the columns of the first but with different content

In combination with the sort functionality this is not possible to style good...
I think the mat-table just lacks flexibility.
It says so, but it is very strict and not flexibel at all...
It would have been better to split the table functionality into attribute directives and leave the html structure to the user

+1

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

savaryt picture savaryt  路  3Comments

LoganDupont picture LoganDupont  路  3Comments

constantinlucian picture constantinlucian  路  3Comments

julianobrasil picture julianobrasil  路  3Comments

michaelb-01 picture michaelb-01  路  3Comments