以下是我的观看代码
<div id="gridContent" / >
@gd.GetHtml(
tableStyle: "gridAlternateRowA",
rowStyle: "gridrow",
headerStyle: "head",
alternatingRowStyle: "altRow",
selectedRowStyle: "select",
htmlAttributes: new { id="MainTable" },
columns: gd.Columns(
gd.Column("","",@<a href= '@Url.Action("edit", "Rig", new { id = item.RigCode })' ><img src="~/Content/Images/edit.PNG" alt="Details" /></a> ,style:"col1"),
gd.Column("","",@<a href= '@Url.Action("delete", "Rig", new { id = item.RigCode })' ><img src="~/Content/Images/delete.PNG" alt="Details" /></a> ,style:"col1"),
gd.Column("username", " username", style: "description"),
gd.Column("address", "address", style: "description"),
gd.Column("CreatedBy", "CreatedBy", style: "description"),
gd.Column("CreatedOn", "CreatedOn", style: "description"),
gd.Column("LastUpdatedBy", "LastUpdatedBy", style: "description"),
gd.Column("LastUpdatedOn", "LastUpdatedOn", style: "description")
))
</div>
<script type="text/javascript">
$(function () {
var tr = $('#MainTable').find('tr');
tr.bind('click', function (event) {
var obj = event.target;
if (obj.nodeName == "TH" || obj.nodeName == "A") { return; }
$('.clickable').removeClass('select');
var tds = $(this).find('td');
$(this).addClass('select');
});
});
</script>