Guest User

Untitled

a guest
Jun 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. @for(status <- lista){
  2. <tr>
  3. <td>@status.getDescricao()</td>
  4. <td><a href="javascript:;" onclick="enviar('formAltStatus/@status.getCodStatus()')"><img src="@routes.Assets.at("img/edit.png")" alt="" title="Editar"/></a>
  5. <a href="@routes.StatusController.removerStatus(status.getCodStatus())"><img src="@routes.Assets.at("img/erase.png")" alt="" title="Remover"/></a>
  6. </td>
  7. </tr>
  8. }
  9.  
  10. GET /formAltStatus/:id controllers.StatusController.formAltStatus(id:Long)
  11.  
  12. function enviar(a){
  13. $.ajax({
  14. url: "/"+a,
  15. type: "GET",
  16. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  17. dataType: "html",
  18. async:true,
  19. success: function(html){
  20. $("#nova").html("");
  21. $("#nova").html(html);
  22. $("#logo").show();
  23. }
  24. });
  25. }
  26.  
  27. <a ... data-status="@status.getCodStatus">
  28.  
  29. <!-- Simple illustration of how to pass server-side data to a JS function -->
  30. <a href="no-javascript.html" class="edit-link" data-status="@status.getCodStatus">
  31. Hyperlink body goes here
  32. </a>
  33.  
  34. $('.edit-link').click(function(e) {
  35. e.preventDefault();
  36. statusCode = $(this).data('status');
  37. alert(statusCode);
  38. });
  39.  
  40. return ok(views.html.database.admin.chargeGroups.render(Json.toJson(commodity)));
  41.  
  42. @(commodity: com.fasterxml.jackson.databind.JsonNode)
  43. @main("Charge Groups") {
  44. <div ng-controller="ChargeGroupsController" ng-init="commodity = @commodity">
Add Comment
Please, Sign In to add comment