mardi 31 mars 2015

How to get NULL as an option in a datagrid relation in sonata admin bundle?

I added the following to a Sonata admin in order to filter by category. However, the list does not show NULL as an option for category. I want also want to be able to filter by category for when category is NULL instead of an entity.


How can one achieve this? My current configuration:



protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
->add("category");
}

Aucun commentaire:

Enregistrer un commentaire