How to change position of element in form from column to one row using EasyAdmin3 in symfony5?

I configure CollectionField in EasyAdmin 3

    public function configureFields(string $pageName): iterable
{
    return [
        yield BooleanField::new('is_active'),
        yield TextField::new('order_title'),
        yield AssociationField::new('client_id'),
        yield CollectionField::new('callPriceProducts')
            ->setEntryType(ProgressProductAttachmentType::class)
            ->setFormTypeOption('by_reference', false)
            ->setTemplatePath('easyadmin3/_call_price_product.html.twig')
            ->onlyOnForms(),
    ];
}

symfony form attached

class ProgressProductAttachmentType extends AbstractType

{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(‘relation_product’, EntityType::class, [
‘class’ => Product::class,
‘choice_label’ => ‘ez_code’,
])
->add(‘progressProduct’, EntityType::class, [
‘class’ => ProgressProduct::class,
‘choice_label’ => ‘progress_code’,
])
->add(‘price’)
;
}

public function configureOptions(OptionsResolver $resolver)
{
    $resolver->setDefaults([
        'data_class' => CallPriceProducts::class,
    ]);
}

Question how to reorder collection fields which comes in column, to one row with elements ?

P.s. setTemplatePath works only on Index or Show

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *