allow json in search response and abstract interactive loading from select2

This commit is contained in:
2018-08-27 13:14:15 +02:00
parent 45946082ea
commit 1826c63251
7 changed files with 46 additions and 23 deletions

View File

@@ -98,6 +98,7 @@ class PostalCodeType extends AbstractType
public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars['attr']['data-postal-code'] = 'data-postal-code';
$view->vars['attr']['data-select-interactive-loading'] = true;
$view->vars['attr']['data-search-url'] = $this->urlGenerator
->generate('chill_main_postal_code_search');
$view->vars['attr']['data-placeholder'] = $this->translator->trans($options['placeholder']);