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