So I have a rather unique situation. I am using JQuery to gather some data based on two date ranges, what is returned as a response in the $data
variable (I am using Ajax) I have set, is a html table.
Now I don't want the user to ever see this table, I want to use This jquery plugin to download the CSV file of that table. The question is, if the table sits inside of a $data
and can be seen via the network tab in Chrom Dev Tools, under Response, is it possible to be manipulated with Jquery?
In our inhouse framework, we do the following to get Ajax Data:
// The following belongs to a JS class method.
data = {
startDate : $('.startDate').val(),
endDate : $('.endDate').val()
}
CT.postSynch('report/payRollReport/downloadPayRoleReport', {data : data}, function(data){
console.log(data);
});
We pass a data object to our Ajax wrapper, call a controller with an action (in this case downloadPayRoleReport
translates to ajaxDownloadPayRoleReport()
) which in turn returns an HTML table, which I can view via console.log(data)
I want to use the above linked plugin on data
to then turn this html table into a csv and instant download.
Question is, can this be done?