<script type="text/x-jsrender" id="columnTemplate">
<a id='editDN' rel='nofollow' href='#' dataval="{{:~formatDate(#data['HireDate'])}}" onclick='return editDnevnice(this);'>{HireDate}</a>
</script>
@{Html.EJ().Grid<object>("Grid")
.Datasource((IEnumerable<object>)ViewBag.data)
.Columns(col =>
{
col.HeaderText("Employee Image").Template("#columnTemplate").Add();
. . . . .
. .. .
})
.Render();
}
<script type="text/javascript">
var helpers = {
formatDate: function (Date) {
return ej.format(Date, "dd.MM.yyyy HH:mm");
}
};//helpers
$.views.helpers(helpers);
function editDnevnice(args) {
var val = $(args).attr("dataVal");
}
</script>
|