Is there a way to use an external kendo template when using the ASP.Net MVC grid helper?
Here's my template:
And I want to use that template in my grid:
Is this possible? With the pasted code, it simply outputs the word "javascriptTemplate"
Here's my template:
<script id=
"javascriptTemplate"
type=
"text/x-kendo-template"
>
var
isToday =
true
;
#if(isToday){#
// show time only e.g. 1:04 PM
#}else{#
// show date and time e.g. 02/06/2013 1:04 PM
#}#
</script>
And I want to use that template in my grid:
@(Html.Kendo().Grid<SiteItem>()
.Name(
"sitesgrid"
)
.Columns( columns =>
{
columns.Bound( s => s.LastReport ).ClientTemplate(
"javascriptTemplate"
);
}
)
.DataSource( ds => ds
.Ajax().Read(
"SitesGrid"
,
"Dashboard"
)
.PageSize( 10 )
.Sort( sort => sort.Add( p => p.SiteName ) )
)
.Pageable( pager => pager
.Messages( messages => messages.Display(
"{0} - {1} of {2} sites"
) )
)
.Filterable()
.Sortable()
.Selectable()
.ColumnMenu()
.Events( events => events.Change(
"onSitesGridSelect"
) )
.Events( events => events.DataBound(
"onGridDatabound"
) )
)
Is this possible? With the pasted code, it simply outputs the word "javascriptTemplate"