Skip to content

Conversation

@rufinus
Copy link

@rufinus rufinus commented Jan 12, 2016

I needed to overwrite your base template to allow select2 filter boxes i got some problems with the positioning, and needed a surrounding div.
After that change the onChange trigger not longer works as it is very restrictive where it searches for the select element.

this pull request tries to relax this a little.

Example of my usecase:

{% extends 'EMCTableBundle::template.html.twig' %}

{% block tfoot %}
    <tr>
        <td colspan="{{ thead|length + (allow_select ? 1 : 0) }}">
            {{ block('pages') }}
            <div class="pull-right">{{ block('limit_select') }}</div>
        </td>
    </tr>
{% endblock %}

{% block limit_select %}
    {% if total > limit %}
        <select id="{{ id }}_limit" class="select2 btn-xs limit" data-width="70px">
            <option value="10">10</option>
            <option value="20">20</option>
            <option value="50">50</option>
            <option value="100">100</option>
            <option value="0">{{ 'All'|trans({}, 'EMCTableBundle') }}</option>
        </select>
    {% endif %}
{% endblock %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant