This is a migrated thread and some comments may be shown as answers.

Detail Template Parameters not recognizing template grid model properties?

1 Answer 200 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sean Bornstein
Top achievements
Rank 1
Sean Bornstein asked on 29 Mar 2013, 05:04 PM
Hello all,

I am trying the detail template today and I have the detail template for my parent grid (pasted below).   The CustomerNumber is coming from the parent grid and I am getting my read result set just fine.  The issue is the parameters I need such as "DocID" you will below are coming up undefined.   Those params are in the model for the template I have DocumentModel.   How do I pass those params from the detail template model versus the parent model?

<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().TabStrip()
.Name("tabStrip_#=CustomerNumber#")
.SelectedIndex(0)
.Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
.Items(items =>
{
items.Add().Text("Attachments").Content(@<text>
@(Html.Kendo().Grid<ABC.DataModel.Document.DocumentModel>()
.Name("grid_#=CustomerNumber#")
.Columns(columns =>
{
columns.Bound(p => p.DocumentType).Width(40).Title("Type").ClientTemplate("#=RenderImage(data)#");
columns.Bound(p => p.DocumentName).ClientTemplate(@Html.ActionLink("#=DocumentName#", "DownloadFile",
new { ID = "#=DocID#", fileRef = "#=FileRef#", fileName = "#=DocumentNameExt#" }).ToHtmlString());
columns.Bound(p => p.ModifiedDate).Title("Modified");
columns.Bound(p => p.ModifiedBy).Title("Modified By");
columns.Bound(p => p.LatestVersion).Title("Latest Version");
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("CustomerAttachments_Read", "Customer", new { library = "#=CustomerNumber#" }))
)
.Pageable()
.Sortable()
.ToClientTemplate())
</text>
);
})
.ToClientTemplate())
</script>

1 Answer, 1 is accepted

Sort by
0
Accepted
Sean Bornstein
Top achievements
Rank 1
answered on 29 Mar 2013, 07:17 PM
Figured this out if accessing the the detail model parameters need to be in the form \\#=OwnProperty\\#  versus #=OwnProperty#
Tags
Grid
Asked by
Sean Bornstein
Top achievements
Rank 1
Answers by
Sean Bornstein
Top achievements
Rank 1
Share this question
or