Symfony 3.0 and Easy Admin: how to customize type field
<p>I'm using EasyAdminBundle and Symfony 3.0 and have a field "status" which is by default textfield and I want it to be choice type but with ability of showing or hiding some other field on change event using javascript.
The problem is that field is rendered but somehow it won't hide field on changing option.
Also, I'm not sure if my approach is good because symfony docs aren't clear enough and, for me, their approach isn't working.</p>

<p>So, code looks like this</p>

<p><strong>MyBundle/Controller/AdminController</strong></p>

<pre><code>public function createEditForm($entity, array $entityProperties)
{
    $editForm = parent::createEditForm($entity, $entityProperties);

    if($entity instanceof Employee){
        $editForm-&gt;remove('status');
        $editForm-&gt;add('status', ChoiceType::class, array(
            'choices' =&gt; array(
                'Working' =&gt; "active",
                'Not working' =&gt; 'inactive'
            )
        ));
    }
    return $editForm;
}

public function createNewForm($entity, array $entityProperties)
{
    $newForm = parent::createNewForm($entity, $entityProperties);

    if($entity instanceof Employee){
        $newForm-&gt;remove('status');
        $newForm-&gt;add('status', ChoiceType::class, array(
            'choices' =&gt; array(
                'Choose an option' =&gt; null,
                'Working' =&gt; true,
                'Not working' =&gt; false
            )
        ));
    }
    return $newForm;
}
</code></pre>

<p><strong>MyBundle/Resources/views/Form/employeestatusfield.html.twig</strong></p>

<pre><code>{% extends 'EasyAdminBundle:default:new.html.twig' %}
{% form_theme form 'EmployeeBundle:Form:employeestatusfield.html.twig' %}

{% block _employee_status_widget %}
        &lt;script type="text/javascript"&gt;
            alert('tiiw');
            $(document).ready(function () {
                toggleFields(); 
                $("#employee_status").change(function () {
                    toggleFields();
                });
            });
            function toggleFields() {
                if ($("#employee_status").valueOf() == 1) {
                    $("#employee_quitAt").hide();
                }
                else
                    $("#employee_quitAt").show();
            }
        &lt;/script&gt;
{% endblock %}
</code></pre>

<p>Thank you for your help.</p>