mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-07 02:01:24 +02:00
19 lines
565 B
JavaScript
19 lines
565 B
JavaScript
|
Behaviour.register({
|
||
|
'input.DataReport_ExportToCSVButton' : {
|
||
|
onclick: function() {
|
||
|
var pageID = $('Form_EditForm_ID').value;
|
||
|
var idParts = this.id.split('_');
|
||
|
var formName = idParts[idParts.length-2];
|
||
|
|
||
|
var reportType = $('DataReport_Type').value;
|
||
|
var url = baseHref() + 'admin/ReportField_Controller/exporttocsv/' + pageID + '/' + reportType + '/' + formName + '.csv';
|
||
|
|
||
|
//alert( url );
|
||
|
//var exportWindow = window.open( url, '_self' );
|
||
|
//alert( exportWindow.location );
|
||
|
window.location.href = url;
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
});
|