mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[DataGrid] Filtering on column header

Open joserodolfofreitas opened this issue 2 years ago • 0 comments

Summary

Enable the possibility of using a filter input on the column's header, either by:

  • Adding a second header row to host an (open) filter for columns.
  • Replacing the title with an input.

Motivation

There are different issues asking for this feature, each requiring something a bit different, which shows the need to leave customization open for this field.

https://github.com/mui/mui-x/issues/4934 https://github.com/mui/mui-x/issues/5973 https://github.com/mui/mui-x/issues/3393 https://github.com/mui/mui-x/issues/1915

The basic solution, and most likely the default, involves adding an input (Usually text, but it could be a select, or other inputs that matches column types) on the second header row assuming a “contains” or “equals” cooperation.

Customizations:

  • Complex filters (example)
  • Custom inputs
  • Custom style

joserodolfofreitas avatar Sep 21 '22 21:09 joserodolfofreitas