Commit ec0fd458 authored by Mat's avatar Mat

un bouton create qui affiche le form, et un bouton edit qui à ce stade ne fait encore rien

parent f92d527b
......@@ -107,7 +107,20 @@
tr.appendChild(td5);
td6 = document.createElement('td');
td6.textContent = 'Editer - Supprimer';
let editBtn = document.createElement('button');
editBtn.innerHTML = '<i class="fas fa-edit fa-fw"></i> Editer';
editBtn.classList.add('btn', 'btn-primary', 'btn-sm');
editBtn.dataset.membreId = json[i].id;
editBtn.addEventListener('click', function(e)
{
console.log('edit');
});
td6.appendChild(editBtn);
tr.appendChild(td6);
tbody.appendChild(tr);
......@@ -117,6 +130,8 @@
}
reloadTableMembre();
let form = document.querySelector('form[name=membre]');
let reloadBtns = document.querySelectorAll('.btn-reload');
reloadBtns.forEach(function(reloadBtn) {
reloadBtn.addEventListener('dblclick', function(e) {
......@@ -125,6 +140,13 @@
});
});
let createBtns = document.querySelectorAll('.btn-create');
createBtns.forEach(function(createBtn) {
createBtn.addEventListener('click', function(e) {
form.parentNode.classList.remove('hidden');
});
});
</script>
{% endblock %}
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