Hello, I want to create a grid with multi level hierachy, but the grid only shows to levels of hierachy. Here is the code of my view:
<div class=
"col-sm-12"
id=
"main"
>
@(Html.Kendo().Grid<CMG_Configuration_Manager.Models.MachineInfo>()
.Name(
"grid"
)
.ToolBar(tools => tools.Pdf())
.Columns(columns =>
{
columns.Bound(o => o.msn_pkfk_serialnr_vchar);
columns.Bound(o => o.mtp_pkfk_gang_vchar);
columns.Bound(o => o.mtp_pkfk_mcid_vchar);
columns.Bound(o => o.msb_kunde_vchar);
})
.HtmlAttributes(
new
{ style =
"height: 800px; width:1000px"
})
.Scrollable(scrollable => scrollable.Height(
"auto"
))
.Groupable()
.Sortable()
.ClientDetailTemplateId(
"TemplateMaterial"
)
.Pageable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Read(read => read.Action(
"getSpGrid"
,
"Home"
))
)
.Events(events => events.DataBound(
"dataBound"
))
)
</div>
</div>
</div>
<script id=
"TemplateMaterial"
type=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<CMG_Configuration_Manager.Models.MaterialInfo>()
.Name(
"grid_#=msn_pkfk_serialnr_vchar#"
)
// template expression, to be evaluated in the master context
.ClientDetailTemplateId(
"TemplateFacility"
)
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.Read(read => read.Action(
"HistorianBinding_Material"
,
"Home"
,
new
{ SerialNr =
"#=msn_pkfk_serialnr_vchar#"
}))
)
.Sortable()
.ToClientTemplate()
)
</script>
<script id=
"TemplateFacility"
type=
"text/kendo-tmpl"
>
@(Html.Kendo().Grid<CMG_Configuration_Manager.Models.FacilityInfo>()
.Name(
"grid_#=bgp_pkfk_bgpnr_vchar#"
)
// template expression, to be evaluated in the master context
.ClientDetailTemplateId(
"TemplateModule"
)
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.Read(read => read.Action(
"HistorianBinding_Facility"
,
"Home"
,
new
{ GroupName =
"#=bgp_pkfk_bgpnr_vchar#"
}))
)
.Sortable()
.ToClientTemplate()
)
</script>
The grid shows the first and second level. At each row of second level is this little arrow to expand the data (where the third level should show up), but when i press the arrow the following error occurs:
Uncaught TypeError: Cannot read property 'replace' of undefined
at Object.compile (kendo.all.min.js:25)
at Object.d [as template] (jquery.min.js:2)
at eval (eval at <anonymous> (jquery.min.js:2), <anonymous>:1:4106)
at Object.n [as syncReady] (kendo.aspnetmvc.min.js:25)
at eval (eval at <anonymous> (jquery.min.js:2), <anonymous>:1:7)
at eval (<anonymous>)
at jquery.min.js:2
at Function.globalEval (jquery.min.js:2)
at Ha (jquery.min.js:3)
at n.fn.init.after (jquery.min.js:3)
Can anybody help or has an idea to do the trick on .net Core MVC?
Regards
Patrick