Add twig pagination for the grid

pull/3064/head
Julio Montoya 5 years ago
parent 4f0308f351
commit f2f2945312
  1. 23
      src/ThemeBundle/Resources/views/Resource/grid_theme.html.twig

@ -164,4 +164,25 @@
<input type="{{ column.inputType }}" value="{{ from }}" class="form-control grid-filter-input-query-from" name="{{ grid.hash }}[{{ column.id }}][from]" id="{{ grid.hash }}__{{ column.id }}__query__from" {% if submitOnChange is same as (true) %}onkeypress="return {{ grid.hash }}_submitForm(event, this.form);"{% endif%} {{ ( op == isNullOperator or op == isNotNullOperator ) ? 'style="display: none;" disabled="disabled"' : '' }} />
</div>
</div>
{% endblock grid_column_filter_type_input %}
{% endblock grid_column_filter_type_input %}
{# ---------------------------------------------------- grid_pager_selectpage -------------------------------------------------- #}
{% block grid_pager_selectpage %}
{{ 'Page'|trans }}
{% spaceless %}
<input type="button" class="btn btn-secondary prev" {% if grid.page <= 0 %}disabled="disabled"{% endif %} value="<" onclick="return {{ grid.hash }}_previousPage();"/>
<input type="text" class="current" value="{{ grid.page + 1 }}" size="2" onkeypress="return {{ grid.hash }}_enterPage(event, parseInt(this.value)-1);"/>
<input type="button" value=">" class="btn btn-secondary next" {% if grid.page >= grid.pageCount-1 %}disabled="disabled"{% endif %} onclick="return {{ grid.hash }}_nextPage();"/> {{ 'of %count%'|trans({ '%count%' : grid.pageCount }) }}
{% endspaceless %}
{% endblock grid_pager_selectpage %}
{# ---------------------------------------------------- grid_pager_results_perpage -------------------------------------------------- #}
{% block grid_pager_results_perpage %}
{{ ', Display'|trans }}
<select onchange="return {{ grid.hash }}_resultsPerPage(this.value);">
{% for key, value in grid.limits %}
<option value="{{ key }}"{% if (key == grid.limit) %} selected="selected"{% endif %}>{{ value }}</option>
{% endfor %}
</select> {{ 'Items per page'|trans }}
{% endblock grid_pager_results_perpage %}

Loading…
Cancel
Save