【问题标题】:Kendo UI ClientTemplate includes condition not working as expectedKendo UI ClientTemplate 包含未按预期工作的条件
【发布时间】:2021-06-25 09:30:12
【问题描述】:

我正在尝试在 Kendo UI 网格的 ClientTemplate 中使用条件。它不适用于多个字符。但是在使用像'#'这样的单个字符时它可以工作。 请提出一个可能的解决方案。我们也可以在这里使用三元运算符吗?

@(Html.Kendo().Grid(Model)
        .Name("marketWatchGrid")
        .Columns(columns =>
        {
            columns.Bound(p => p.Clients).ClientTemplate("# if(Clients.indexOf(''')>-1) { # #= Clients # #} else {# #: Clients # #}#")
        })
    );

【问题讨论】:

    标签: asp.net-mvc kendo-ui


    【解决方案1】:

    如果您需要在模板中使用文字哈希符号,您需要使用一个或多个 \ 字符对其进行转义。

    Kendo UI Grid - Client Template: Escaping # sign

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-13
      • 1970-01-01
      • 2013-06-04
      • 2015-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多