<script id="templateData" type="text/x-jsrender">
<tr>
<td class="photo">
<img src="../Content/images/Employees/{{:EmployeeID}}.png" alt="{{:EmployeeID}}" />
</td>
<td class="details">
<table class="CardTable" cellpadding="3" cellspacing="2">
<colgroup>
<col width="50%">
<col width="50%">
</colgroup>
<tbody>
<tr>
<td class="CardHeader">First Name </td>
<td>{{:FirstName}} </td>
</tr>
..
</tbody>
</table>
</td>
</tr>
</script>
}
@section ControlsSection{
@(Html.EJ().Grid<EmployeeView>("RowTemplate")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowScrolling()
.ScrollSettings(scroll => { scroll.Height(380).Width(500); })
.RowTemplate("#templateData")
.Columns(col =>
{
col.HeaderText("Photo").Width(30).Add();
col.HeaderText("Employee Details").Width(70).Add();
})
)
} |
@(Html.EJ().Grid<EmployeeView>("RowTemplate")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowScrolling()
.AllowPaging(true)
.ScrollSettings(scroll => { scroll.Height(380).Width(500); })
.RowTemplate("#templateData")
.Columns(col =>
{
col.Field("EmployeeID").HeaderText("Photo").Width(30).Add();
col.Field("FirstName").HeaderText("Employee Details").Type("string").Width(70).Add();
})) |