条件语句嵌入客户端模板剑道UI MVC网格(服务器)剑道、网格、语句、客户端

2023-09-06 15:18:31 作者:感情淡了请放盐

内的剑道格,我想显示一个链接,用户如果管理者不分配, 其他显示管理器的已分配的名称。为管理员可以为空,我有成功,得到该链接,只显示当经理不为空。 但问题是,如果管理者不为空如何diaplay在其他部分经理的名字

下面是客户端模板,我试图使用方法:

  @(Html.Kendo()。网格(模型)
 。名称(网格)
 .Columns(列=>
 {
     columns.Bound(O => o.AccountManager).title伪(客户经理)
    .ClientTemplate(#如果(的AccountManager == NULL){#+ @ Html.ActionLink(分配,行动,控制器,新{@caseId =#= CaseID#,@tabIndex =0 },{新@Title =查看})。ToHtmlString()+#}其他{#+如何dispaly这里的客户经理的值+#}#)。HtmlAttributes(新{@style =文本对齐:中心});
 })
 

解决方案

解决it.this可以帮助其他面临同样的问题。

  @(Html.Kendo()。网格(模型)
。名称(网格)
.Columns(列=>
{
  columns.Bound(O => o.AccountManager)。.title伪(客户经理)ClientTemplate(#如果(的AccountManager == NULL){#+ @ Html.ActionLink(分配,行动,控制器,新{@caseId =#= CaseID#,@tabIndex =0},{新@Title =查看})。ToHtmlString()+#}其他{#+#=的AccountManager #+#}#)HtmlAttributes(新{@style =文本对齐:中心});
})
 

Windows好软件系列2 Terminus,最佳控制台集成软件

Inside a Kendo Grid, I'd like to display a link to the user if manager is not assigned , else display the name of manager already assigned . as the manager can be null, I'm having success getting this link to only show when the manager is not null. but problem is if manager is not null how to diaplay the manager name in else part

Below is the client template I'm trying to use:

@(Html.Kendo().Grid(Model)    
 .Name("Grid")
 .Columns(columns =>
 {
     columns.Bound(o => o.AccountManager).Title("Account Manager")
    .ClientTemplate("# if (AccountManager == null) { #" + @Html.ActionLink("Assign", "action", "Controller", new { @caseId = "#=CaseID#", @tabIndex = "0" }, new { @Title = "View"}).ToHtmlString() + "# }else {#" + "how to dispaly value of account manager here" + "#} #").HtmlAttributes(new {@style = "text-align:center" });  
 })       

解决方案

Solved it.this may help others facing same problem

@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
  columns.Bound(o => o.AccountManager).Title("Account Manager").ClientTemplate("# if (AccountManager == null) { #" + @Html.ActionLink("Assign", "action", "Controller", new { @caseId = "#=CaseID#", @tabIndex = "0" }, new { @Title = "View"}).ToHtmlString() + "# }else {#" +  "#=AccountManager#" + "#} #").HtmlAttributes(new {@style = "text-align:center" });  
})