@(Html.EJ().Grid<EmployeeView>("HierarchyGrid") .Datasource((IEnumerable<object>)ViewBag.datasource) . . . .. .Columns(col => { col.Field("EmployeeID").HeaderText("Employee ID").Width(75).Add(); . . . . .. . col.HeaderText("Actions").Width(20).Template("<a rel='nofollow' href='/Home/Contact'>Edit</a>").Add(); }) .ClientSideEvents(events=>events.TemplateRefresh("templateRefresh")) )
<script> function templateRefresh(args) { var rel='nofollow' href = $(args.cell).find("a").attr("rel='nofollow' href"); $(args.cell).find("a").attr("rel='nofollow' href", rel='nofollow' href + "?Page=" + this.model.pageSettings.currentPage + "&SelectedRow=" + args.rowIndex); //this.getRowByIndex(args.rowIndex); to get a row based on index //this.model.currentViewData[args.rowIndex]; to get the current data based on the index } |