Commit 18fad11e authored by Mat's avatar Mat

test en console les boutons de tri par colonne et le select de pagination

parent 77424206
......@@ -69,7 +69,7 @@
<a href="javascript: void(0);" id="association" class="btn-sort">Association</a>
</th>
<th scope="col">
<a href="javascript: void(0);" id="action" class="btn-sort">Action</a>
<a>Action</a>
</th>
</tr>
</thead>
......@@ -216,15 +216,23 @@
form);
});
let stepform = document.querySelector('form#pagination');
let stepform = document.querySelector('form#pagination select');
stepform.addEventListener('change', function(e) {
console.log('change pagination');
step = this.value;
console.log('change step='+ step);
console.log();
});
let columns = ['id', 'firstname', 'lastname', 'email'];
columns.forEach(function(column) {
column.addEventListener('click', function(e) {
console.log('toggle column');
let columns = document.querySelectorAll('th[scope="col"] a.btn-sort');
columns.forEach(function(column)
{
let col = column.getAttribute('id');
column.addEventListener('click', function(e)
{
console.log('toggle id='+ col+ ' order='+ order);
order = (order === 'ASC') ? 'DESC' : 'ASC';
});
});
......
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