hhurz / tableExport.jquery.plugin

jQuery plugin to export a html table to JSON, XML, CSV, TSV, TXT, SQL, Word, Excel, PNG and PDF
MIT License
990 stars 716 forks source link

tableexport doesn't work with requirejs and jspdf #298

Closed pcoemar closed 4 years ago

pcoemar commented 4 years ago

Hi, all required js are loaded but I have this issue: Captura You support would be apreciated

hhurz commented 4 years ago

Hi, I guess you missed loading jspdf.min.js or loading of the file failed. Thats the only reason of the ReferenceError "jsPDF is not defined" I know.

pcoemar commented 4 years ago

Hi, yes sure is loaded, have a look. Captura Kind regards,

hhurz commented 4 years ago

A simple web search for "RequireJS jsPDF" shows a couple of issues regarding this combination. Among others the issues https://github.com/MrRio/jsPDF/issues/869 and https://github.com/MrRio/jsPDF/issues/1317 lead me to supose that jsPDF doesn't work if it is loaded using requireJS. But this is out of scope of the tableExport plugin...

pcoemar commented 4 years ago

I don't know if is in the scope or not, but the excepcion happen in tableExport.js.

hhurz commented 4 years ago

Ofcourse the exception happens there, because the plugin uses jsPDF. I'm not able to solve incompatibilities between RequireJs and jsPDF. There are two solutions 1) Don't use the PDF export fomat of the plugin (or the plugin at all) or 2) Don't use RequireJS

pcoemar commented 4 years ago

Ok, thanks for your support.