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

Number format within ClientTemplate

2 Answers 520 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Iron
Steven asked on 28 Nov 2014, 11:21 AM
Hi,

I'm struggling to get the client template working with any number format other than 'n' or 'c2' for a bound column.

The following doesn't work and gives a javascript error -> Uncaught Error: Invalid template

boundcol.ClientTemplate("#= data.C0 !== null ? kendo.toString(data.C0,'##,#') : ''#");

Any ideas?

Steven.

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Rusev
Telerik team
answered on 02 Dec 2014, 08:48 AM
Hello Steven,

Hash symbols in the template must be escaped as listed bellow:

"#= data.Freight !== null ? kendo.toString(data.Freight,'\\#\\#,\\#') : ''#"

Regards,
Nikolay Rusev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Steven
Top achievements
Rank 1
Iron
answered on 02 Dec 2014, 12:35 PM
Thanks Nikolay that worked
Tags
Grid
Asked by
Steven
Top achievements
Rank 1
Iron
Answers by
Nikolay Rusev
Telerik team
Steven
Top achievements
Rank 1
Iron
Share this question
or