adding twig extensions to select how many items per page

* twig anchor: {{ chill_items_per_page(pagination) }}
* select field changed with javascript event listener
This commit is contained in:
2021-07-16 13:23:10 +02:00
parent d2c631ae20
commit 3ee676600e
7 changed files with 98 additions and 10 deletions

View File

@@ -70,8 +70,6 @@ class ThirdPartyController extends Controller
$nbThirdParties = $repository->countByMemberOfCenters($centers);
$pagination = $this->paginatorFactory->create($nbThirdParties);
$pagination->setItemsPerPage(20);
$thirdParties = $repository->findByMemberOfCenters(
$centers,
$pagination->getCurrentPage()->getFirstItemNumber(),

View File

@@ -15,6 +15,7 @@
<nav class="filter-actions border border-secondary my-4 p-3">
filter nav
{{ dump() }}
</nav>
</div>
@@ -23,7 +24,7 @@
<div class="col-md-10 col-xxl">
<label class="counter">
<span>xxx</span> {{ 'third parties'|trans }}
<span>{{ pagination.totalItems }}</span> {{ 'third parties'|trans }}
</label>
<table class="table table-striped table-hover align-middle">
@@ -82,11 +83,7 @@
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<select class="form-select" aria-label="itemsPerPage">
<option value="20">20 / page</option>
<option value="50">50 / page</option>
<option value="100">100 / page</option>
</select>
{{ chill_items_per_page(pagination) }}
</li>
{% if is_granted('CHILL_3PARTY_3PARTY_CREATE') %}
<li>