Commit 3caf6d52 authored by Mat's avatar Mat

on insère notre bouton éditer

parent 723e77a6
......@@ -54,7 +54,7 @@
<script type="text/javascript">
// L'URL de l'API
let ownersURL = '{{ path('api_owner_read') }}';
let ownersURL = Routing.generate('api_owner_read');
// Le tableau
let table = document.querySelector("table#table-owners");
......@@ -96,11 +96,21 @@
tr.appendChild(td3);
let td4 = document.createElement('td');
td4.innerHTML =
'<a class="btn btn-primary" href="#"><i class="fas fa-edit fa-fw"></i> Editer</a>'
+ '<a class="btn btn-danger" href="#"><i class="fas fa-trash fa-fw"></i> Supprimer</a>';
let editBtn = document.createElement('button');
editBtn.setAttribute('data-owner-id', json[i].id);
// W3C cette notation est conseillée pour un attr custom
editBtn.innerHTML = '<i class="fas fa-edit fa-fw"></i> Editer';
editBtn.classList.add('btn', 'btn-primary');
editBtn.addEventListener('click', function() {
});
td4. appendChild(editBtn);
tr.appendChild(td4);
// '<a class="btn btn-primary" href="#">Editer</a>'
// + '<a class="btn btn-danger" href="#"><i class="fas fa-trash fa-fw"></i> Supprimer</a>';
tbody.appendChild(tr);
//console.log(json[i].firstname);
......
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