【问题标题】:Escape percentage "%" in Kendo UI template剑道 UI 模板中的转义百分比“%”
【发布时间】:2017-12-22 00:03:17
【问题描述】:

我正在尝试在我的 Kendo UI 模板中转义百分比“%”,有人可以帮忙吗?

我的代码:

$donePercentageInput.kendoSlider({
            increaseButtonTitle: "Right",
            decreaseButtonTitle: "Left",
            min: 0,
            max: 100,
            smallStep: 1,
            largeStep: 5,
            tooltip: {
                template: kendo.template("#= value \\\\% #")
            }
        });

试过//%////%\\%\\\\%没有用... :(

【问题讨论】:

    标签: kendo-ui escaping kendo-template


    【解决方案1】:

    这是一个很容易解决的问题。这只是您放置% 符号的一种情况。

    如果您将模板更改为:

      tooltip: {
                    template: kendo.template("#= value #%")
                }
    

    那么这对你有用。

    这是一个演示:

    http://dojo.telerik.com/iGoLOc

    拖动顶部滑块,您将看到工具提示。

    通过将% 放在#= # 中,您是在要求基诺计算出添加了这个奇怪符号的值,它不喜欢它。

    【讨论】:

    • 这是stackoverflow.com/questions/19377094/… 的正确答案我能够在定义的模板模式(即template: kendo.template("#= value - 1 #%"))中进行计算,在所有情况下都会返回事件值负1,这正是我需要。
    猜你喜欢
    • 2015-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多