5 Answers, 1 is accepted
0
Quang
Top achievements
Rank 1
answered on 25 Apr 2011, 07:46 PM
Hi
please help me.
'reqstDT' is datetime type. now i want to format it output "yyyy-MM-dd". but i don't know anyway to do that.
<#=reqstDT#>
thanks so much.
please help me.
'reqstDT' is datetime type. now i want to format it output "yyyy-MM-dd". but i don't know anyway to do that.
<#=reqstDT#>
thanks so much.
columns.Bound(o => o.empCode).ClientTemplate("<a onclick=\"WM_Script.onEditPOERegist('<#=empCode#>','<#=reqstDT#>','<#=ctfFlag#>');\"><button>Edit</button><a>").Encoded(false).Title("").Width(40);0
Demon
Top achievements
Rank 1
answered on 26 Apr 2011, 07:34 AM
The columns have a Format() method. Check out the demos source:
http://demos.telerik.com/aspnet-mvc/grid
http://demos.telerik.com/aspnet-mvc/grid
0
Quang
Top achievements
Rank 1
answered on 26 Apr 2011, 07:48 AM
thanks for support.
but i use ('<#=empCode#>','<#=reqstDT#>','<#=ctfFlag#>'); 3 field. i think unable to use format function. i tried..
but i use ('<#=empCode#>','<#=reqstDT#>','<#=ctfFlag#>'); 3 field. i think unable to use format function. i tried..
0
Demon
Top achievements
Rank 1
answered on 26 Apr 2011, 08:19 AM
Sorry, I didn't notice you are using client templates :)
In this case you should change the <#= #> string to <# #> in the client template. Afterwards the content inside the expression is not returned, but evaluated as Javascript code (notice you need a return statement now). For example this is the simplest way to return an unformatted value:
Now you can use Javascript to format the date client-side and return a concatenated string of tags and formatted values, according to your preference.
http://stackoverflow.com/questions/1056728/formatting-a-date-in-javascript
In this case you should change the <#= #> string to <# #> in the client template. Afterwards the content inside the expression is not returned, but evaluated as Javascript code (notice you need a return statement now). For example this is the simplest way to return an unformatted value:
.ClientTemplate("<# return reqstDT; #>")Now you can use Javascript to format the date client-side and return a concatenated string of tags and formatted values, according to your preference.
http://stackoverflow.com/questions/1056728/formatting-a-date-in-javascript
0
Quang
Top achievements
Rank 1
answered on 26 Apr 2011, 06:23 PM
That is so good to support.
Thank you so much, Demon.
Thank you so much, Demon.