Skip to content

[Form] EntityType option to work with big choices in view #57724

Closed
@andreybolonin

Description

@andreybolonin

Description

In some cases in EntityType we need to use Select2 for speedup rendering tens of thousend rows in field

If I use 'choices' => [] we will got validate errors from selected with Select2 field

Would be greate to have 'ajax' => true option, which dont send on frontend choices, but validate submitted data, as traditional

WDYT?

Example

 $builder
            ->add('contact', EntityType::class, [
                'class' => Contact::class,
                'choice_label' => 'name',
                'required' => true,
                'placeholder' => '',
                'ajax' => true,
            ])
Screenshot 2024-07-15 at 11 19 10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions