Closed esaesa closed 6 years ago
@esaesa – I will investigate because this doesn't look correct. I will acknowledge that mobile support is not fully cross-platform (e.g. Safari mobile and some of the less common/popular mobile browsers). At the end of the day, this data is generated client-side, so full compatibility is not feasible, but most major mobile browsers should be supported, or this is a bug.
Now that I can recall, xlsx
/ xls
was so inconsistent on mobile browsers that it was disabled untill support could be delivered in a safe, consistent manner. I may have a fix but extensive cross-platform (and cross device) testing will be needed before I can safely add this support. Both csv
and txt
are fully supported, so logic can be added for mobile environments either in TableExport or in the implementation until this can be resolved. Sorry for the inconvenience.
The error "xlsx" requires "js-xlsx".
is specifically related to a missing dependencies, so there is something 🐟y going on here (to your point about _isMobile
check) and this error is misleading ... the purpose was originally to short-circuit the execution (hence why the button is not added for xlsx
). There was a known issue with dataURIs on iphone (xlsx & xls)
and native mobile browser support for Blob which may no longer be a problem. Either way, the issue(s) on mobile related to xls
and xlsx
need to be triaged and addressed. This will be fixed in the next minor release. Thanks for you help!
This sample https://tableexport.v3.travismclarke.com/examples/exportButtons.html and its modified v5 is not showing the xlsx button with a console warning tableexport.min.js:19 "xlsx" requires "js-xlsx".
I searched the code and i found
which will return always false in mobile devices and so generate the error as dependency is required although it is loaded correctly and working in other older examples. You can note in the image only two buttons instead of 3 as desktop version.
Update: 25,Apr. 2014