I have a grid with the export to excel functionality turned on:
@(Html.Kendo().Grid<
IncompleteCOATests
>()
.Name("IncompleteCOATestsGrid")
.HtmlAttributes(new { style = "width: 980px" })
.Columns(columns =>
{
columns.Bound(c => c.UnitId).Title("Unit Id");
columns.Bound(c => c.ParentId).Title("Parent Id");
columns.Bound(c => c.Qparam).Title("QParam");
columns.Bound(c => c.TestAlias).Title("Test Name");
})
.ToolBar(tools => tools.Excel())
.Excel(excel => excel
.FileName("Missing Tests.xls")
.Filterable(true)
.ProxyURL(Url.Action("Excel_Export_Save", "Grid")))
.NoRecords(x => x.Template(@ResourceMessages.NoRecordFoundForConsignee))
.AutoBind(false)
.Pageable(pageable => pageable
.Enabled(false)
.Refresh(true)
.PageSizes(false))
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("GlobalModule.onError"))
.Read(read => read.Url(Url.HttpRouteUrl("ActionApi", new { controller = "PoPsApi", action = "GetIncompleteCOATests" })).Type(HttpVerbs.Get).Data("IncompleteCoAsModule.getLoadOrderItem")))
)
It databinds on a client-side button press
export function showMissingTests(e) {
$('#IncompleteCOATestsGrid').data("kendoGrid").dataSource.read();
}
Is it possible to set the excel.Filename property client side?
When/how in the page lifecyle would I do that?