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

String Formatting in ClientRowTemplate (Fluent)

2 Answers 180 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kai
Top achievements
Rank 1
Kai asked on 11 Mar 2013, 06:36 PM
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 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 13 Mar 2013, 10:43 AM
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!
0
Dimiter Madjarov
Telerik team
answered on 13 Mar 2013, 11:09 AM
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!
Tags
Grid
Asked by
Kai
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or