SHARE
TWEET

Untitled

a guest Jun 20th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top