In my BookAdmin.php file, I wrote this function :
protected function configureFormFields(FormMapper $formMapper) {
$formMapper->add('number', null, array('label' => 'Number'))
->add('title', null, array('label' => 'Title'))
->add('idcategory', 'sonata_type_model',
array('label' => 'Category', 'required' => true),
array('edit' => 'list'));
}
When I create a new book, the generated form displays a jquery popup window to select the category, but it displays all categories.
I have to display a category sublist (for example, categories where status = active). How can I do that ?
(it's ok if I don't use a 'edit' => 'list' - displays a simple combo box - but the combo box contains too many rows)