Guest User

Untitled

a guest
Jan 23rd, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. <div class="container">
  2. <h2>Basic Table</h2>
  3. <p>Angular 7 open bootstrap 4 modal popup with dynamic data on click on bootstrap table row</p>
  4. <table class="table table-hover">
  5. <thead>
  6. <tr>
  7. <th>Firstname</th>
  8. <th>Lastname</th>
  9. <th>Email</th>
  10. <th>Action</th>
  11. </tr>
  12. </thead>
  13. <tbody>
  14. <tr class="table-primary">
  15. <td id="firstname1">John</td>
  16. <td id="lastname1">Doe</td>
  17. <td id="email1">john@example.com</td>
  18. <td id="1" (click)="onClick($event)" style="cursor: pointer;font-weight: bold;">Show</td>
  19.  
  20. </tr>
  21. <tr class="table-success">
  22. <td id="firstname2">Mary</td>
  23. <td id="lastname2">Moe</td>
  24. <td id="email2">mary@example.com</td>
  25. <td id="2" (click)="onClick($event)" style="cursor: pointer;font-weight: bold;">Show</td>
  26. </tr>
  27. <tr class="table-danger">
  28. <td id="firstname3">July</td>
  29. <td id="lastname3">Dooley</td>
  30. <td id="email3">july@example.com</td>
  31. <td id="3" (click)="onClick($event)" style="cursor: pointer;font-weight: bold;">Show</td>
  32. </tr>
  33. </tbody>
  34. </table>
  35.  
  36. <!-- The Modal -->
  37. <div class="modal" id="myModal" [style.display]="showModal ? 'block' : 'none'">
  38. <div class="modal-dialog">
  39. <div class="modal-content">
  40.  
  41. <!-- Modal Header -->
  42. <div class="modal-header">
  43. <h4 class="modal-title">User Details:</h4>
  44. <button type="button" class="close" data-dismiss="modal" (click) = "hide()">&times;</button>
  45. </div>
  46.  
  47. <!-- Modal body -->
  48. <div class="modal-body">
  49. <p>User Id : {{UserId}}</p>
  50. <p>Firstname : {{Firstname}}</p>
  51. <p>Lastname : {{Lastname}}</p>
  52. <p>Email : {{Email}}</p>
  53. </div>
  54.  
  55. <!-- Modal footer -->
  56. <div class="modal-footer">
  57. <button type="button" class="btn btn-danger" data-dismiss="modal" (click) = "hide()">Close</button>
  58. </div>
  59.  
  60. </div>
  61. </div>
  62. </div>
  63. </div>
Add Comment
Please, Sign In to add comment