Search code examples
kendo-uiescapingkendo-template

Escape percentage "%" in Kendo UI template


I'm trying to escape percentage "%" in my Kendo UI template, can someone help.

Error :( My Code:

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

Have tried //% ////% \\% \\\\% nothing works... :(


Solution

  • This is a simple one to fix. It is simply a case of where you are putting the % symbol.

    if you change the template to:

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

    then that will work for you.

    here is a demo:

    http://dojo.telerik.com/iGoLOc

    drag the top slider and you will see the tool tip.

    by placing the % in the #= # you are asking keno to work out the value provided with this odd symbol added to it and it doesn't like it.