Commit 4218d390 authored by Mat's avatar Mat

tri et pagination des membres, bug résolu. reste à gérer les pages

parent 1b78e916
......@@ -42,8 +42,8 @@
{{ form_start(formMembre) }}
{{ form_errors(formMembre) }}
{{ form_row(formMembre.nom) }}
{{ form_row(formMembre.prenom) }}
{{ form_row(formMembre.nom) }}
{{ form_row(formMembre.email) }}
{{ form_row(formMembre.association) }}
<hr>
......@@ -64,10 +64,10 @@
<a href="javascript: void(0);" id="id" class="btn-sort">#</a>
</th>
<th scope="col">
<a href="javascript: void(0);" id="firstname" class="btn-sort">Prénom</a>
<a href="javascript: void(0);" id="prenom" class="btn-sort">Prénom</a>
</th>
<th scope="col">
<a href="javascript: void(0);" id="lastname" class="btn-sort">Nom</a>
<a href="javascript: void(0);" id="nom" class="btn-sort">Nom</a>
</th>
<th scope="col">
<a href="javascript: void(0);" id="email" class="btn-sort">Email</a>
......@@ -96,7 +96,7 @@
let table = document.querySelector('table#maintab.membres');
let tbody = table.querySelector('tbody');
let paginate = { 'step': 10, 'page': 1, 'col': 'id', 'order': 'DESC' };
let paginate = { 'step': 10, 'page': 1, 'column': 'id', 'order': 'DESC' };
/*
* Recharge la table
......@@ -105,9 +105,9 @@
function reloadTableMembre(paginate)
{
tbody.innerHTML = null;
let membreURL = Routing.generate('api_membre_read_paginate', paginate);
tbody.innerHTML = null;
AJAX('GET', membreURL, function(request)
{
let json = JSON.parse(request.responseText);
......@@ -248,14 +248,9 @@
let stepform = document.querySelector('form#pagination select');
stepform.addEventListener('change', function(e)
{
step = (this.value === '-1') ? 10 : this.value;
paginate.step = step;
console.log(paginate);
reloadTableMembre(paginate);
console.log('change step='+ step);
});
/*
......@@ -276,8 +271,9 @@
}
});
paginate.col = col;
paginate.column = col;
paginate.order = (paginate.order === 'ASC') ? 'DESC' : 'ASC';
console.log(paginate);
reloadTableMembre(paginate);
let th = this.parentNode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment