String Formatting in ClientRowTemplate (Fluent)

3 posts, 0 answers
  1. Kai
    Kai avatar
    25 posts
    Member since:
    Jul 2012

    Posted 11 Mar 2013 Link to this post

    I have this line of code
    .ClientRowTemplate("#=kendo.toString(DtSundayOpenTime, \"hhmm\")#")
    However I keep getting an invalid Template error. How can I format this to display only the time (12 or 24hr). Thanks
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2284 posts

    Posted 13 Mar 2013 Link to this post

    Hi Kai,


    The row template is used to define the template for the whole row as shown in this Demo. If you want to define the template for a single column, you should use the ClientTemplate method.

    E.g.
    .ClientTemplate("Time: #= kendo.toString(new Date(), 'hh:mm') #");

     

    Regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2284 posts

    Posted 13 Mar 2013 Link to this post

    Hello again Kai,


    If only the time should be displayed on each row, than the ClientRowTemplate is indeed the way to go. The template syntax seems correct. Could you send me the exact error, that you are getting or provide a sample project, so I could assist you further?

    Wish you a great day!

     

    Greetings,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top