0

Is there any way to disable filters based on selected option in Easy Admin ?

For example, I have a select operation with 3 options : campaign, channel and file, and I want to disable text filter team when file option is selected

Here is my code :

public function configureFilters(Filters $filters): Filters
{
    $objects = array(
        'campaign' => 'campagnes',
        'channel'=> 'voies',
        'file' => 'fichiers'
    );
    return $filters
        ->add(ChoiceFilter::new('operation', 'objets')->setChoices($objects))
        ->add(TextFilter::new('serviceId', 'service'))
        ->add(TextFilter::new('team', 'équipe');
}
zackzulg
  • 599
  • 2
  • 5
  • 21
  • You cannot do that without overriding the _filter_modal template to add custom javascript to do so – Dylan KAS Nov 03 '22 at 13:05
  • I tried to override it but I have this error : The "crud\includes\_filters_modal" template is not defined in EasyAdmin – zackzulg Nov 03 '22 at 14:14

0 Answers0