javascript - Save grid data to CSV file using Perl -
here grid data:
"order","id","comment" "1.00","345.00","do this" "2.00","475.00","dont this"
the first column column header order, id , comment. next 2 columns data.
the above grid data collected , put in variable named data
var data= \$("#jqxgrid").jqxgrid('exportdata', 'csv');
now transferring data via ajax @ backend. need ensure data goes through ajax. , gives me alert "success" when click on save button. here code save button onclick()
\$(document).ready(function() { \$("#savefile").click(function() { var data= \$("#jqxgrid").jqxgrid('exportdata', 'csv'); console.log(data); \$.ajax({ type: "post", url: "http://apmqa.mcm.com/cgi-bin/test/web_editor.pl?action=savetocsv", datatype: "html", data:data, success: function (data) { alert('success'); }, error: function () { alert('error'); }); console.log(data); }); });
the above code in perl , thats why see \ before every $sign. transfer data through ajax.
this url below has function "savetocsv". need run function , ensure passed 'data' saved in csv file.
my question 1) doing right specifying location of function called in url. below statement correct ?
url: "http://apmqa.mcm.com/cgi-bin/test/web_editor.pl?action=savetocsv",
if yes, data go method.
2) need convert data csv file. can let me know how convert data in csv file using perl?
it of great if looks important issue.
Comments
Post a Comment