TableExport icon indicating copy to clipboard operation
TableExport copied to clipboard

How to download the excel file without adding to DOM?

Open TheInvoker opened this issue 6 years ago • 0 comments

I'm using this right now to force the download automatically. How can I do this in the more cleaner intended way? (because it feels like a hack right now)

        exportToExcel : function(table, filename, sheetname) {
            var g = $(table).hide();
            $("body").append(g);
            $(g).tableExport({
                filename: filename,
                formats: ["xlsx"],
                sheetname : sheetname
            });
            g.find("caption button").click();
            g.remove();
        },

TheInvoker avatar Jul 26 '19 20:07 TheInvoker