@(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.ClientSideEvents(eve => eve.RecordClick("recordclick"))
.Columns(col =>
{
col.Field("EmployeeID").HeaderText("Employee ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();
col.Field("EmployeeName").HeaderText("Name").Width(100).Add();
col.Field("City").Width(100).Add();
})
)
<script>
function recordclick(args) {
//Get the details of the row when click the name of the employee
if ($(args.cell).index() == 1) {
alert("Employee ID:" + args.data.EmployeeID + "\nName:" + args.data.EmployeeName + "\nCity:" + args.data.City);
}
}
</script> |
@(Html.EJ().Grid<object>("FlatGrid")
. . .
.Columns(col =>
{
. . .
col.HeaderText("Manage Records").Template("<a rel='nofollow' href='#''>{{:OrderID}}</a>").Add();
})
) |