Jquery库symfony集合不适用于element

时间:2017-07-06 18:51:28

标签: javascript jquery symfony

当我在自定义表单主题中添加元素时,我的集合的增量不起作用!

我使用此库:https://github.com/ninsuo/symfony-collection

{% block PriceType_row %}
    {{ form_widget(form) }}
{% endblock %}

{% block PriceType_widget %}
    <tr>
        <td>
            {{ form_widget(form.quantityFrom, {'attr': {'class': 'form-control'}}) }}
        </td>
        <td>
            {{ form_widget(form.quantityTo, {'attr': {'class': 'form-control'}}) }}
        </td>
        <td>
            {{ form_widget(form.bestUnitPrice, {'attr': {'class': 'form-control'}}) }}
    </td>
    <td>
        {{ form_widget(form.getPaid, {'attr': {'class': 'form-control'}}) }}
    </td>
    <td>
        {{ form_widget(form.vatRate, {'attr': {'class': 'form-control'}}) }}
    </td>
</tr>
{% endblock %}

{% block ProductType_widget %}
    {{ form_widget(form.prices) }}l
{% endblock %}

感谢您的帮助! :)

1 个答案:

答案 0 :(得分:0)

[自动回复]

我在我的收藏集javascript

中添加elements_selector
$('.collection-prices').collection({
   elements_selector: '> tr',
});