Skip to content

Creating a TreeListDataSource instance using the HTML Helpers does not set the DataSource type #6664

Closed
@aleksandarevangelatov

Description

@aleksandarevangelatov

Bug report

Creating a TreeListDataSource instance using the HTML Helpers does not set the DataSource type.

Reproduction of the problem

  1. Define a TreeListDataSource
@(Html.Kendo().DataSource<Kendo.Mvc.Examples.Models.TreeList.EmployeeDirectoryRemoteModel>()
    .Name("treedata")
    .TreeList(dataSource => dataSource
        .ServerOperation(true)
        .Read(read => read.Action("Index", "EmployeeDirectory"))
        .Model(m => {
            m.Id(f => f.EmployeeId);
            m.ParentId(f => f.ReportsTo);
            m.Field(f => f.FirstName);
            m.Field(f => f.LastName);
            m.Field(f => f.ReportsTo);
        })
    )
)
  1. Inspect the generated script and note the type is not set to aspnetmvc-ajax - Example REPL. Defining the DataSource as part of the TreeList component sets the type as expected - TreeList Remote DataBinding Demo

Expected/desired behavior

TreeListDataSource instance defined as a standalone component or as part of the TreeList component should have the same configuration.

Workaround

If you need to use an external DataSource with an ASP.NET Core TreeList HTML Helper configure the TreeListDataSource using Kendo UI for jQuery:

var TreeListDataSource = new kendo.data.TreeListDataSource({
        type: "aspnetmvc-ajax",
        transport: {
           //transport configuration
        },
        schema: {
          //schema configuration
        }
       //additional configuration options
})

Environment

  • Kendo UI version: 2021.3.1207
  • Browser: [all]

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions