Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. formulario.html
  2. <div class="form-group" id="div-table-pacientes">
  3. </div>
  4.  
  5. paciente.html
  6. <div class="ocultar" id="html-table-pacientes">
  7. <table class="table " id="table-pacientes">
  8. <thead>
  9. <tr>
  10. <th>#</th>
  11. <th>Nombre</th>
  12. <th>Apellido</th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. </tbody>
  17. </table>
  18. </div>
  19.  
  20. pacinete.js
  21. $("#btn-registrar-tratamiento").on("click", function(){
  22. $("#div-table-pacientes").html($("#html-table-pacientes").html());
  23.  
  24. function cargarTablaPaciente() {
  25. axios.get("/control/lista_paciente/")
  26. .then(response => {
  27. console.log(response.data);
  28.  
  29. $("#table-pacientes").DataTable({
  30. destroy: true,
  31. pageLength: false,
  32. data: response.data,
  33. ordering: false,
  34. lengthMenu: [ [3, 10, 25, -1], [3, 10, 25, "All"] ],
  35. //lengthChange: true,
  36. paging: true,
  37. columns: [
  38. { 'data': 'id' },
  39. { 'data': 'nombres' },
  40. { 'data': 'apellidos' },
  41. ]
  42. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement