Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. <a id="exportExcelFatturaIcon" href ="${createLink(action: 'downloadExcel', params: [fileName:excelFileName])}" hidden>click here</a>
  2. <a id="exportCsvFatturaIcon" href ="${createLink(action: 'downloadCSV', params: [fileName:csvFileName])}" hidden>click here</a>
  3.  
  4. $("#exportFatturaButton").click(function(){
  5. var startDate = $("#startDateFattura").val();
  6. var endDate = $("#endDateFattura").val();
  7. $("#loaderModal").modal('show');
  8. $.ajax({
  9. url: "${createLink(controller: 'ExportData',action: 'getDataBySearch')}",
  10. data: {
  11. startDate: startDate,
  12. endDate:endDate
  13. },
  14. dataType: "html",
  15. type: "POST",
  16. success: function (data) {
  17. $("#loaderModal").modal('hide');
  18. document.getElementById("exportExcelFatturaIcon").click();
  19. document.getElementById("exportCsvFatturaIcon").click();
  20. },
  21. error: function (xhr, status) {
  22. $("#loaderModal").modal('hide');
  23. }, complete: function (xhr, status) {
  24. $("#loaderModal").modal('hide');
  25. }
  26. });
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement