Hi Team,
After upgraded kendo components and using bootstrap 5 as shown below:
"@progress/kendo-theme-bootstrap": "^8.0.1",
"@progress/kendo-ui": "^2024.2.514",
"@types/esprima": "^4.0.5",
"@types/he": "^1.2.2",
"@types/kendo-ui": "^2023.2.5",
"bootstrap": "^5.2.1",
The export Excel in kendo TreeList triggering an error:
TypeError: data.slice is not a function
at init.success (kendo.data.js:3858:1)
at success (kendo.data.js:3748:1)
at options.success (kendo.data.js:2219:1)
at fire (jquery.js:3496:1)
at Object.fireWith [as resolveWith] (jquery.js:3626:1)
at done (jquery.js:9786:1)
at XMLHttpRequest.<anonymous> (jquery.js:10047:1)
Here is the code I am using, the exporting Excel is not working, could someone please help ?
@(
Html.Kendo().TreeList<DevelopmentEmployeeDirectoryRemoteModel>()
.Name("development-tree-list-basic")
.DataSource(dataSource => dataSource
.Read(read => read.Url($"{Url.Content("~")}/Development?handler=KendoTreeListDataSourceRead").Data("forgeryToken"))
.Model(m =>
{
m.Id(f => f.EmployeeId);
m.ParentId(f => f.ReportsTo).Nullable(true);
m.Field(f => f.FirstName);
m.Field(f => f.LastName);
m.Field(f => f.ReportsTo);
})
.ServerOperation(false))
.Columns(columns =>
{
columns.Add().Field(f => f.FirstName).Width(250);
columns.Add().Field(e => e.LastName);
columns.Add().Field(e => e.Position);
columns.Add().Field(e => e.Extension).Title("Ext").Format("{0:#}");
})
.Toolbar(tools => {
tools.Pdf();
tools.Excel();
tools.Spacer();
tools.Search();
})
.Excel(excel => excel.FileName("Kendo UI TreeList Export.xlsx").ProxyURL(Url.Action("Excel_Export_Save", "Development")))
.Pdf(pdf => pdf.FileName("Kendo UI TreeList Export.pdf")
.AllPages()
.PaperSize("A4")
.Margin("2cm", "1cm", "1cm", "1cm")
.Landscape(true))
//.ColumnMenu()
.Filterable()
.Selectable(true)
.Scrollable(false)
.Sortable()
.Resizable(true)
.Reorderable(true)
.Deferred(true)
)