Issue
I see code in Codepend. But i want to change filename Excel download. Pls help me
Link :https://codepen.io/marco27384/pen/pboLyx
Solution
You want to modify the download attribute of the href. That's not possible with setting the window.location.href in the current code. Instead, here's an example which creates a new anchor tag, sets up the download and href attributes. Finally the link is clicked and we have our downloaded file, myname.xls
$timeout(function() {
var a = document.createElement('a')
a.href = exportHref
a.download = 'myname.xls'
a.click()
// $timeout(function(){location.href=exportHref;},100);
// trigger download
}, 100)
Answered By - JamesIngold
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.