【问题标题】:TM symbol rendering as ™ in Kendo window titleTM 符号在 Kendo 窗口标题中呈现为 ™
【发布时间】:2018-05-31 14:11:57
【问题描述】:

我有一个非常基本的剑道窗口,我需要在标题中包含 TM 符号。出于某种原因,它呈现为 ™,我无法在网上找到任何与此特定情况有关的内容。

这是我的代码,我遇到问题的标题在底部:

@(Html.Kendo().Window().Name("SmartHomeTerminationModal")
.Actions(a => a.Minimize().Close())
.Animation(false)
.Content(
    @<text>
        <div class="container-fluid midco-k-window-content">
            <div class="row">
                <div class="col-xs-12">
                    @if (Model != null)
                    {
                        <table class="table table-bordered table-condensed table-striped">
                            <tr>
                                <th>Install Date</th>
                                <th>Months in Contract</th>
                                <th>Months Remaining</th>
                                <th>Equipment Fee</th>
                                <th style="width: 20px;"></th>
                                <th>Total</th>
                            </tr>
                            <tr>
                                <td>@Model.InstallDate.ToShortDateString()</td>
                                <td>@Model.MonthsInContract</td>
                                <td>@Model.MonthsRemaining</td>
                                <td>@Model.EquipmentFee.ToString("C")</td>
                                <td>=</td>
                                <td><strong>@Model.EquipmentFee.ToString("C")</strong></td>
                            </tr>
                        </table>
                    }
                    else
                    {
                        @Html.ErrorMessage("We were unable to retrieve SmartHOME termination fee information.")
                    }
                </div>
            </div>
        </div>
    </text>)
.Draggable()
.Title("SmartHOME&trade;")
.Visible(false)
.Width(800))

【问题讨论】:

    标签: razor kendo-ui unicode-string


    【解决方案1】:

    您可以使用 alt 代码将 TM 符号添加到标题字符串。为此,请按住 Alt 并在标题字符串中键入代码(TM 为 0153)。

    .Title("SmartHOME™")
    

    【讨论】:

      【解决方案2】:

      这可以通过将事件绑定到窗口的打开来完成,如下所示:

      .Events(eve => eve.Open("onOpen"))
      

      然后给它附加一个简单的函数

      function onOpen(e) {
      
              var title = $("span.k-window-title"); 
      
              title.html('&trade; hello');
          }
      

      这只是针对窗口标题,然后你在其中应用你想要的任何文本,所以如果你想要一个图标或其他东西,那么你可以在这里应用它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-03-10
        • 1970-01-01
        • 1970-01-01
        • 2011-05-19
        • 1970-01-01
        相关资源
        最近更新 更多