Advertisement
Guest User

Untitled

a guest
Jul 28th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.13 KB | None | 0 0
  1. $(document).on('click', '.glyphicon-pencil', function(event) {
  2. var row = $(this).closest('tr');
  3. var id = row.find("input[name='edit-id']").val();
  4. $.get('/country/' + id + '/edit', function(data) {
  5. row.html(data['html']).find('div').slideDown('400');
  6. });
  7. });
  8.  
  9. <table class="table table-striped table-responsive">
  10. <thead>
  11. <tr>
  12. <th>Nombre</th>
  13. <th>Continente</th>
  14. <th>Capital</th>
  15. <th>Lengua</th>
  16. <th>Habitantes</th>
  17. <th>Moneda</th>
  18. <th></th>
  19. <th></th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <tr>
  24. <td>asdfasdfsdfsf</td>
  25. <td></td>
  26. <td></td>
  27. <td></td>
  28. <td>0</td>
  29. <td></td>
  30. <td>
  31. <form method="POST" action="http://localhost:8000/country/all" accept-charset="UTF-8" class="pull-right"><input name="_token" value="uc1Sozi7LBtDGAxjCVQz1lDjv0bh963U1erlqMAv" type="hidden">
  32. <span class="glyphicon glyphicon-pencil btn btn-xs btn-success"></span>
  33. <input name="edit-id" value="1" type="hidden">
  34. </form>
  35. </td>
  36. <td>
  37. <form method="POST" action="http://localhost:8000/country/all" accept-charset="UTF-8" class="pull-right"><input name="_token" value="uc1Sozi7LBtDGAxjCVQz1lDjv0bh963U1erlqMAv" type="hidden">
  38. <span class="glyphicon glyphicon-remove btn btn-xs btn-danger"></span>
  39. <input name="id" value="1" type="hidden">
  40. </form>
  41. </td>
  42. </tr>
  43.  
  44. </tbody>
  45. </table>
  46.  
  47. <table class="table table-striped table-responsive">
  48. <thead>
  49. <tr>
  50. <th>Nombre</th>
  51. <th>Continente</th>
  52. <th>Capital</th>
  53. <th>Lengua</th>
  54. <th>Habitantes</th>
  55. <th>Moneda</th>
  56. <th></th>
  57. <th></th>
  58. </tr>
  59. </thead>
  60. <tbody>
  61. <tr><td colspan="0">
  62. <div style="" class="row">
  63. <div style="" class="form-group col-md-12">
  64. <div style="" class="col-md-2">
  65. <label for="name" class="control-label">Nombre</label>
  66. </div>
  67. <div style="" class="col-md-10">
  68. <input class="form-control" autocomplete="off" placeholder="Nombre del país" id="update-name" name="name" value="asdfasdfsdfsf" type="text">
  69. </div>
  70. </div>
  71. <div style="" class="form-group col-md-12">
  72. <div style="" class="col-md-2">
  73. <label for="continent" class="control-label">Continente</label>
  74. </div>
  75. <div style="" class="col-md-10">
  76. <input class="form-control" autocomplete="off" placeholder="Continente donde se encuentra" id="update-continent" name="continent" value="" type="text">
  77. </div>
  78. </div>
  79. <div style="" class="form-group col-md-12">
  80. <div style="" class="col-md-2">
  81. <label for="capital" class="control-label">Capital</label>
  82. </div>
  83. <div style="" class="col-md-10">
  84. <input class="form-control" autocomplete="off" placeholder="Ciudad capital" id="update-capital" name="capital" value="" type="text">
  85. </div>
  86. </div>
  87. <div style="" class="form-group col-md-12">
  88. <div style="" class="col-md-2">
  89. <label for="language" class="control-label">Lengua</label>
  90. </div>
  91. <div style="" class="col-md-10">
  92. <input class="form-control" autocomplete="off" placeholder="Lengua oficial" id="update-language" name="language" value="" type="text">
  93. </div>
  94. </div>
  95. <div style="" class="form-group col-md-12">
  96. <div style="" class="col-md-2">
  97. <label for="population" class="control-label">Habitantes</label>
  98. </div>
  99. <div style="" class="col-md-10">
  100. <input class="form-control" autocomplete="off" placeholder="Número total de habitantes" id="update-population" name="population" value="0" type="text">
  101. </div>
  102. </div>
  103. <div style="" class="form-group col-md-12">
  104. <div style="" class="col-md-2">
  105. <label for="currency" class="control-label">Moneda</label>
  106. </div>
  107. <div style="" class="col-md-10">
  108. <input class="form-control" autocomplete="off" placeholder="Moneda que se usa" id="update-currency" name="currency" value="" type="text">
  109. </div>
  110. </div>
  111. <div style="" class="form-group col-md-12">
  112. <span class="glyphicon glyphicon-floppy-disk btn btn-success"></span>
  113. <span class="glyphicon glyphicon-ban-circle btn btn-primary"></span>
  114. <input name="update-id" value="1" type="hidden">
  115. </div>
  116. </div>
  117. </td></tr>
  118.  
  119. </tbody>
  120. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement