@(Html.EJ().Grid<EmployeeView>("CustomGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.EnableRowHover(false)
.AllowSelection(false)
.Columns(col =>
{
col.Field("EmployeeID").HeaderText("Employee ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(100).Add();
col.Field("FirstName").HeaderText("First Name").Width(100).Add();
col.Field("LastName").HeaderText("Last Name").Width(100).Add();
col.Field("HireDate").HeaderText("Hire Date").TextAlign(TextAlign.Right).Width(100).Format("{0:MM/dd/yyyy}").Add();
col.Field("Country").Width(100).HeaderText("Country").Add();
col.HeaderText("Employee Details").Commands(command =>
{
command.Type("detail")
.ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties()
{
Text = "Details",
Width = "100px",
Click = "onClick"
}).Add();
})
.IsUnbound(true)
.TextAlign(TextAlign.Left)
.Width(150)
.Add();
})
)
………………………………
<script type="text/javascript">
function onClick(args) {
$(args.target.closest("tr")).find("td").css("text-decoration", "line-through"); // to strike the text inside the td element
}
</script>
//To remove the strike use below css
$(args.target.closest("tr")).find("td").css("text-decoration", "none ");
|
|