Telerik asp.net mvc GridBoundColumnBuilder.ClientTemplate删除'++'字符?

时间:2015-09-16 18:20:31

标签: asp.net-mvc telerik

这对我来说很奇怪,但cshtml视图:

@{ 
    var platformsClientTemplate = @" 
    # var names = []; for(int i=0; i<Platforms.length; i++) { names.push(Platforms[i].Name);} #
    #=  names.join(', ') # ";
}

@(
 Html.Kendo().Grid<ApplicationUserViewModel>()
    .Columns(cols =>
    {
      // ...
      cols.Bound(u => u.Platforms).ClientTemplate(platformsClientTemplate).Width(300);
      // ...
    }
    // ...
 )

转换为此客户端的html(“查看源代码”):

jQuery(function(){jQuery("#UsersGrid").kendoGrid({"columns":[
// ....
{ title: "mytitle",
 //...
 "template":" # var names = []; for(int i=0; i\u003cPlatforms.length; i  ) { names.push(Platforms[i]);} # #=  names.join(\u0027, \u0027) # "
 }
 //...
]});

看起来'++'删除是错误的。如何在不使用forEach等新方法的情况下枚举此客户端模板中的模型?

0 个答案:

没有答案