Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

giving a userdefined name to the file #2

Closed
nairvishal opened this issue Aug 7, 2014 · 5 comments
Closed

giving a userdefined name to the file #2

nairvishal opened this issue Aug 7, 2014 · 5 comments

Comments

@nairvishal
Copy link

Great plugin bro. Is it possible to give a default user defined file name . Right now it directly shows 'download' as the name of the file.One more thing what in the case of two tables.How to export both the tables in one file ? I think giving them a common class and then calling with class instead of id won't work , right ?

@erayaydin
Copy link

👍 Its will good

@rainabba
Copy link
Owner

rainabba commented Apr 4, 2015

narivshal: As soon as I can figure out to how access all the elements of the selector which the plugin is called on, I'll have an update that provides multiple table functionality. Kinda stuck on this bit for now though.

As for the filename, I think that's a function of the browser and I don't know how to control that yet or if it can be controlled.

@erayaydin
Copy link

You can create an a element and set "download" parameter. I fixed with this method:

// tableToExcel method of plugin:
var link = e.uri + e.base64(e.format(e.template, e.ctx));
var a = document.createElement("a");
a.download = "File Name.xls";
a.href = link;
a.click();

@rainabba rainabba closed this as completed Apr 7, 2015
@rainabba
Copy link
Owner

rainabba commented Apr 7, 2015

Implemented as filename option in 1.0.3

@rainabba rainabba reopened this Apr 7, 2015
@rainabba rainabba closed this as completed Apr 7, 2015
@erayaydin
Copy link

Thats awesome! Thank you 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants