I am trying to replicate the functionality of the hierarchy grid as shown in the demos. This is the code I have in my views:
@(Html.Kendo().Grid<CrewListing>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(x => x.Truck);
columns.Bound(x => x.Name);
columns.Bound(x => x.ActiveOrder);
columns.Bound(x => x.ServicePoint).Filterable(false);
columns.Bound(x => x.Region).Filterable(false);
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("RefreshTable", "Crew"))
.Sort(sort => sort.Add(x => x.Truck).Descending())
)
.ClientDetailTemplateId("crewOrderTemplate")
.Filterable()
.Pageable()
.Sortable()
)
<script id="crewOrderTemplate" type="text/kendo-template">
@(Html.Kendo().Grid<CrewOrderListing>()
.Name("grid_#=Truck#")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetCrewOrders", "Crew"))
.Sort(sort => sort.Add(x => x.Customers).Descending())
)
.Columns(columns =>
{
columns.Bound(o => o.Order);
columns.Bound(o => o.Device);
columns.Bound(o => o.Customers);
columns.Bound(o => o.OrderType);
})
.Pageable()
.Filterable()
.Sortable()
.ToClientTemplate())
</script>
What ends up happening is I get the error "Invalid Template" in my browser console. If I make the detail template standalone by placing it outside the <script> block and removing the ToClientTemplate() function, it renders properly. My application does NOT have the AntiXssEncoder loaded.
@(Html.Kendo().Grid<CrewListing>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(x => x.Truck);
columns.Bound(x => x.Name);
columns.Bound(x => x.ActiveOrder);
columns.Bound(x => x.ServicePoint).Filterable(false);
columns.Bound(x => x.Region).Filterable(false);
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("RefreshTable", "Crew"))
.Sort(sort => sort.Add(x => x.Truck).Descending())
)
.ClientDetailTemplateId("crewOrderTemplate")
.Filterable()
.Pageable()
.Sortable()
)
<script id="crewOrderTemplate" type="text/kendo-template">
@(Html.Kendo().Grid<CrewOrderListing>()
.Name("grid_#=Truck#")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetCrewOrders", "Crew"))
.Sort(sort => sort.Add(x => x.Customers).Descending())
)
.Columns(columns =>
{
columns.Bound(o => o.Order);
columns.Bound(o => o.Device);
columns.Bound(o => o.Customers);
columns.Bound(o => o.OrderType);
})
.Pageable()
.Filterable()
.Sortable()
.ToClientTemplate())
</script>
What ends up happening is I get the error "Invalid Template" in my browser console. If I make the detail template standalone by placing it outside the <script> block and removing the ToClientTemplate() function, it renders properly. My application does NOT have the AntiXssEncoder loaded.