I have a grid that I'm assigning as a child template to a parent grid. The child template looks like this:
In particular, this line is what I need help with: Name("grid_#=Enrolment.EnrolmentId#")
That line doesn't work - the parser fails (returns a Javascript error saying "Invalid template"). It seems to be the use of dot syntax within that Name method that's causing the issue. If I change my template to this:
The EnrolmentId is output with no issues, proving that the item exists and the property exists and is populated. It seems to be using the dot syntax in the Name method specifically that is causing the problem.
<script id=
"client-template"
type=
"text/x-kendo-template"
>
@(Html.Kendo().Grid<EnrolledUnit>()
.Name(
"grid_#=Enrolment.EnrolmentId#"
)
.Columns(columns =>
{
columns.Bound(enrolledUnit => enrolledUnit.DisplayName);
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read
.Action(
"EnrolledUnits_Read"
,
"EnrolledUnits"
,
new
{ enrolmentId =
"1"
})
)
)
.ToClientTemplate()
)
</script>
In particular, this line is what I need help with: Name("grid_#=Enrolment.EnrolmentId#")
That line doesn't work - the parser fails (returns a Javascript error saying "Invalid template"). It seems to be the use of dot syntax within that Name method that's causing the issue. If I change my template to this:
<script id=
"client-template"
type=
"text/x-kendo-template"
>
#=Enrolment.EnrolmentId#
</script>
The EnrolmentId is output with no issues, proving that the item exists and the property exists and is populated. It seems to be using the dot syntax in the Name method specifically that is causing the problem.