api de gestion de ticket, basé sur php-crud-api. Le but est de décorrélé les outils de gestion des données, afin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

datatables.html 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <html>
  2. <head>
  3. <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"/>
  4. <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.js"></script>
  5. <script type="text/javascript" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
  6. <script>
  7. $(document).ready(function() {
  8. $('#example').DataTable( {
  9. ajax: {
  10. url: '/api.php/records/posts?join=categories&join=users',
  11. dataSrc: 'records'
  12. },
  13. columns: [
  14. { data: "id" },
  15. { data: "user_id.username" },
  16. { data: "category_id.name" },
  17. { data: "content" }
  18. ]
  19. });
  20. });
  21. </script>
  22. </head>
  23. <body>
  24. <table id="example" class="display" style="width:100%">
  25. <thead>
  26. <tr>
  27. <th>ID</th>
  28. <th>Username</th>
  29. <th>Category</th>
  30. <th>Content</th>
  31. </tr>
  32. </thead>
  33. <tfoot>
  34. <tr>
  35. <th>ID</th>
  36. <th>Username</th>
  37. <th>Category</th>
  38. <th>Content</th>
  39. </tr>
  40. </tfoot>
  41. </table>
  42. </body>
  43. </html>