Guest User

Untitled

a guest
Apr 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. th:onclick="'javascript:openPoolModal(''+ ${networkHashrate.id} + '');'"
  2.  
  3. function openPoolModal(id){
  4.  
  5. $.ajax({
  6. url: "/" + id,
  7. success: function(data){
  8. $("#PoolModalHolder").html(data);
  9. $("#personalModal").modal();
  10. $("#personalModal").modal('show');
  11. }
  12. });
  13. }
  14.  
  15. <div class="modal fade" id="personalModal" role="dialog" th:fragment="modalContents">
  16. <div class="modal-dialog">
  17.  
  18. <div class="modal-content">
  19.  
  20. <div class="modal-header">
  21. <button type="button" class="close" data-dismiss="modal">&times;</button>
  22. <h4 class="modal-title" th:text="'Network Id: ' + ${poolHashrates[0].networkHashrate.id}">Network Id</h4>
  23. </div>
  24.  
  25. <div class="modal-body">
  26. <div class="table-responsive">
  27. <table width="100%" class="table table-hover " id="poolTable">
  28.  
  29. <thead class="thead-inverse">
  30. <tr>
  31. <th class="col-md-2 text-center">Pool name</th>
  32. <th class="col-md-2 text-center">Date from</th>
  33. <th class="col-md-2 text-center">Hashrate</th>
  34. </tr>
  35. </thead>
  36.  
  37. <tbody>
  38. <tr th:each="poolHashrate : ${poolHashrates}">
  39. <td class="text-center" th:text="${poolHashrate.poolDef.name}"> Sample data</td>
  40. <td class="text-center" th:text="${poolHashrate.poolDef.date_from}">Maven Street 10, Glasgow</td>
  41. <td class="text-center" th:text="${poolHashrate.hashrate}">999-999-999</td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49.  
  50. $(document).ready( function () {
  51. $('#poolTable').DataTable();
  52. } );
  53.  
  54. $( "#personalModal" ).focus(function() {
  55. $('#poolTable').DataTable();
  56. });
Add Comment
Please, Sign In to add comment