This is a migrated thread and some comments may be shown as answers.

Absolute value function in a template

2 Answers 379 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Frederic
Top achievements
Rank 1
Frederic asked on 08 Jun 2012, 12:27 PM
Hello,
I'd like to print on the screen absolute values by a template.
I've tried things like that :
valueAxis: {
     labels: {
          template: "#Math.abs(value)#"
}}

or equivalent by using javascript and jquery but I couldn't find this out.
Anyone can help ? Thanks !

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 11 Jun 2012, 06:54 AM
Hi Frederic,

The right template syntax in your case is #= <js code> #, for example:
columns: [
    {
        title: "foo",
        field: "foo",
        template: "#= Math.abs(foo) #"
    }
]


I hope this information helps.

All the best,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Frederic
Top achievements
Rank 1
answered on 11 Jun 2012, 07:35 AM
Thanks !! That's it !
Tags
Templates
Asked by
Frederic
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Frederic
Top achievements
Rank 1
Share this question
or