Category : jquery-select2

Im having a select2 choicetype field in my form which is using ajax to retrieve choices from an API. It is part of a symfony form. The field is configured like this: ->add(‘places’, ChoiceType::class, [ ‘multiple’ => true, ‘label’ => $this->t->trans(‘places’), ‘attr’ => [‘class’ => ‘select2-multiple’], ‘label_attr’ => [‘class’ => ‘control-label’], ‘help’ => $this->t->trans(‘create_new_announcement_places_help’), ‘constraints’ ..

Read more

I’ve created a form (with Symfony 5) with a CollectionType: $builder ->add(‘movieBiographies’, CollectionType::class, array(‘label’ => false, ‘entry_type’ => MovieBiographyAdminType::class, "allow_add" => true, "allow_delete" => true, "entry_options" => ["language" => $language])); Inside my CollectionType, there is a Select2 field: $builder ->add(‘biography’, Select2EntityType::class, [ ‘multiple’ => false, ‘remote_route’ => ‘Biography_Admin_Autocomplete’, ‘class’ => Biography::class, ‘page_limit’ => 10, ‘primary_key’ ..

Read more

I am tring to use this Select2 bundle into my Symfony project. https://github.com/tetranz/select2entity-bundle NUCLEI ENTITY /** * Nuclei * * @ORMTable(name="datinuclei") * @ORMEntity(repositoryClass="AppRepositoryNucleiRepository") */ class Nuclei { /** * @var int * * @ORMId * @ORMColumn(name="id", type="integer", nullable=false) * @ORMGeneratedValue(strategy="NONE") */ private $id; /** * @var string * * @ORMColumn(name="codicenucleo", type="string", nullable=false) */ private $codicenucleo; ..

Read more