Number format within ClientTemplate

3 posts, 1 answers
  1. Steven
    Steven avatar
    3 posts
    Member since:
    Dec 2012

    Posted 28 Nov 2014 Link to this post

    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. Answer
    Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 02 Dec 2014 Link to this post

    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.

     
  3. Steven
    Steven avatar
    3 posts
    Member since:
    Dec 2012

    Posted 02 Dec 2014 in reply to Nikolay Rusev Link to this post

    Thanks Nikolay that worked
Back to Top