Skip to content

Conversation

@alexandre-castelain
Copy link
Contributor

Description

This merge request adds support for column filters, as explained in #85

$builder
    ->addColumn('name', TextColumnType::class, [
        'label' => 'Full name',
        'sort' => true,
        'filter' => StringFilterType::class,
]);

You can pass options to the filter using the filter_options array:

$builder
    ->addColumn('name', TextColumnType::class, [
        'label' => 'Full name',
        'sort' => true,
        'filter' => StringFilterType::class,
        'filter_options' => [
            'operator_selectable' => true,
        ],
    ]);

Note:
A field cannot have both a header filter (via addFilter()) and a column filter (via the column's filter option) at the same time.
Attempting to add both types of filters for the same field will result in an InvalidArgumentException.

Points to check

  • Verify if using a boolean to distinguish filter types is sufficient, or if we should switch to an enumeration.
  • I have not tested all filter options, but the ones I tried seem to work correctly.
  • Only the base.html.twig file was modified. Maybe we should improve the other template, but I'm not sure it's necessary. As you wish.

@alexandre-castelain
Copy link
Contributor Author

Hi @Kreyu ! :)
Any news about those MR ? I know it takes a lot of time to review, but I just want to check if it will be possible to be merged one day or not at all because it's not on your roadmap ?
Thanks,
Have a good day !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant