我有这个子网格。我正在尝试使用行ID(在实际行上看起来很好)..但是当我尝试在ClientTemplate内部的超链接中使用它时,它是null。带有CTID的绑定列工作正常...数字显示。但是在使用链接时它不会显示...它显示为空。
(例如http://[link-info-here]/DispForm.aspx?ID=null)
任何帮助?
<script id="criticalTopicsTemplate" type="text/kendo-tmpl">
@(Html.Kendo().Grid<DashboardViewModel>()
.Name("grid_#=TopicID#")
.Columns(columns =>
{
columns.Bound(cr => cr.CTID); // CTID does appear here and on the grid
columns.Bound(cr => cr.CTTitle).Title("CT Name");
columns.Bound(cr => cr.CTStatus).Title("Status");
columns.Bound(cr => cr.CTPercentComplete).Title("Percent");
columns.Bound(cr => cr.CTEnd).Title("Target");
columns.Bound(cr => cr.CTCertified).Title("Certified");
columns.Bound(cr => cr.CTOwner).Title("Owner");
columns.Bound(cr => cr.CTExecStakeholder).Title("Stakeholder");
columns.Bound(cr => cr.OpenPRs).Title("Open PRs");
columns.Bound(cr => cr.CompletedPRs).Title("Completed PRs");
columns.Bound(cr => cr.OtherPRs).Title("Other PRs");
columns.Command(command => command.Custom("Details").Click("showDetails")).Title("Critical Topic Details");
columns
.Bound(cr => cr.CTID) // CTID works here too
.Template(@<text></text>)
.Title("Actions")
.ClientTemplate("<a href='http://<link-info-here>/DispForm.aspx?ID=#=CTID#' target='_blank' class='k-button link'>View</a>" + // CTID = null
"<a href='http://<link-info-here>/EditForm.aspx?ID=#=CTID#' target='_blank' class='k-button link'>Edit</a>"); // CTID = null
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetCriticalTopics", "Hierarchy", new { title = "#=TopicTitle# " }).Data("filterOptions"))
.PageSize(20)
)
.Pageable()
.Sortable()
.ClientDetailTemplateId("partnerTemplate")
.ToClientTemplate()
)
</script>
答案 0 :(得分:0)
我修好了。需要逃脱身份证。
.ClientTemplate("<a href='http://<link-info-here>/DispForm.aspx?ID=\\#=CTID\\#' target='_blank' class='k-button link'>View</a>");