jquery - Export CSV using jqxgrid in Safari browser and iOS is not working -


in web application have option export "jqxgrid" data ".csv" format.

it working expected in chrome & firefox browsers. but, if, tried export option in 'safari' browser opening in tab, instead of download separate file.

is possible download separate file?

sample code:

 $("#gridexport").click(function () {         exportdata = [];         var exporttype = getexportformat(); //csv (or) xls         exportinfo = $("#jqxgrid").jqxgrid('exportdata', exporttype);         exportinfo = replaceall(exportinfo, '<br/>', ' ');         try {             var prm = {};             prm.exportinfo = exportinfo;             savemyfile("$('submitform')", "test" + "." + exporttype, exportinfo, "text/" + exporttype + ";charset=utf-8");         }         catch (e) {             console.log('export error: ' + e);         }     });   function savemyfile(ref, fname, text, mime) {     try {         var blob = new blob([text], { type: mime });         saveas(blob, fname);         return false;     } catch (e) {         console.log('savemyfile: ' + e.message);     } }       function getexportformat() {             var strplatform = navigator.platform;         if (strplatform.tolowercase().indexof('ipad') > -1 ||                 strplatform.tolowercase().indexof('iphone') > -1 ||                                   strplatform.tolowercase().indexof('mac') > -1)             return "csv";         else             return "xls";     } 


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -