Hi, so I am trying to set the proxy url for the export to excel functionality. I've already developed a jsp to serve the data but then they switched my project to MVVM, and now I am not sure how to set the proxy url.
I am calling the saveAsExcel() function from a custom function (we have a custom grid toolbar so I had to make my own export button).
Some code included below, where do I set the proxy URL?
In the grid view:
data-toolbar= [{'template':kendo.template($("#break-details-toolbar-template").html())}]
In the view toolbar template:
<div class="toolbar">
<button id="excelButton" class="excelButton k-button"
data-role="button"
data-bind="visible: isVisible, enabled: isEnabled,{ click: exportExcel }">
<i class="fa fa-file-excel-o"></i> Export To Excel
</button>
<button id="pdfButton" class="pdfButton k-button"
data-role="button"
data-bind="visible: isVisible, enabled: isEnabled,{ click: exportPdf }">
<i class="fa fa-file-pdf-o"></i> Export To PDF
</button>
</div>
click handler calls this function:
function exportToExcel(gridID, columnsToExclude){
$("div[data-role='grid']").each(function(){
if( $(this)[0].id == gridID ){
var grid = $(this).closest("div[data-role='grid']").data("kendoGrid");
//loop through columns to hide columns to ignore
for(var i = 0; i < grid.columns.length; i++){
for(var j = 0; j < columnsToExclude.length; j++){
console.log(columnsToExclude[j]);
if(columnsToExclude[j] === grid.columns[i].title){
console.log("Match found - hiding column");
grid.columns[i].hidden = true;
}
}
}
grid.saveAsExcel();
}
});
};