Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a id="exportExcelFatturaIcon" href ="${createLink(action: 'downloadExcel', params: [fileName:excelFileName])}" hidden>click here</a>
- <a id="exportCsvFatturaIcon" href ="${createLink(action: 'downloadCSV', params: [fileName:csvFileName])}" hidden>click here</a>
- $("#exportFatturaButton").click(function(){
- var startDate = $("#startDateFattura").val();
- var endDate = $("#endDateFattura").val();
- $("#loaderModal").modal('show');
- $.ajax({
- url: "${createLink(controller: 'ExportData',action: 'getDataBySearch')}",
- data: {
- startDate: startDate,
- endDate:endDate
- },
- dataType: "html",
- type: "POST",
- success: function (data) {
- $("#loaderModal").modal('hide');
- document.getElementById("exportExcelFatturaIcon").click();
- document.getElementById("exportCsvFatturaIcon").click();
- },
- error: function (xhr, status) {
- $("#loaderModal").modal('hide');
- }, complete: function (xhr, status) {
- $("#loaderModal").modal('hide');
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement