In my org we have a Vf page with a download link. Onclick of this link a csv file is downloaded. This is working absolutely fine with Chrome and Firefox, but the file doesn't download with IE. Any help is very much appreciated. Here is the code:
vf:
<apex:includeScript value="{!URLFOR($Resource.CC_PavilionDownloadPricing, 'underscore-min.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.CC_PavilionDownloadPricing, 'react.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.CC_PavilionDownloadPricing, 'react-dom.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.CC_PavilionDownloadPricing, 'browser.min.js')}"/>
getPricingData() {
CC_PavilionDownloadPricingCtrl.getorderItemsFromPriceBookEntry(
function(results, event) {
$('#myModal').modal('hide')
var key = _.keys(results)[0];
var today = moment().format("MM D YYYY");
var values = _.values(results)[0];
var data = [];
for(var idx = 0; idx < values.length; idx++) {
data.push({
'Part Number': values[idx].productCode !== undefined ? values[idx].productCode : '',
'Description': values[idx].productName !== undefined ? values[idx].productName : '',
'UM': values[idx].UM !== undefined ? values[idx].UM : 'EA',
'List Price': values[idx].listPrice !== undefined ? values[idx].listPrice : '',
'Disc. Price': values[idx].discountPrice !== undefined ? values[idx].discountPrice : '',
'Qty Disc': values[idx].qtyDiscount !== undefined ? values[idx].qtyDiscount : '',
'Qty Price': values[idx].qtyPrice !== undefined ? values[idx].qtyPrice : '',
'Type': values[idx].code !== undefined ? values[idx].code : 'GC'
});
}
JSONToCSVConvertor(data, key, today, true);
}, {
buffer: false
}
);
},
render: function() {
return (
<div className="col-md-10">
<div className="panel panel-default">
<div className="panel-heading" data-toggle="modal" data-target="#myModal" onClick={this.getPricingData}>Download Pricing</div>
</div>
</div>
);
}
});
var ModalBox = React.createClass({
render: function() {
return (
<div id="myModal" className="modal fade" tabIndex="-1" role="dialog">
<div className="modal-dialog">
<div className="modal-content">
<div className="modal-header">
<h4 className="modal-title">Please Wait...</h4>
</div>
<div className="modal-body">
<center><img id="loading" src="/img/loading32.gif" /></center>
</div>
{/* modal-content */}
</div>
{/* modal-dialog */}
</div>
{/* modal */}
</div>
);
}
})
Not sure sure if i had to add any javascript library for the download to work.