[英]How to highlight jqgrid row after new record inserted
我试图在jqgrid中突出显示新插入的记录,尝试了此链接
但是afterCompleate无法启动,请尝试使用gridview:false,没有运气,使用mvc 4和jqgrid版本4.4.4 ............................... ....................................
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('#GridList').jqGrid({
autoencode: true,
autowidth: true,
caption: 'List',
datatype: 'json',
jsonReader: { 'repeatitems': false, 'id': 'dataJson' },
emptyrecords: 'No record Found',
gridview: true,
height: '100%',
loadui: 'block',
pager: '#pager',
rowList: [10, 15, 20, 50],
rowNum: 20,
viewsortcols: [true, 'vertical', true],
shrinkToFit: true,
url: '@Url.Action("List")',
viewrecords: true,
width: '650',
colModel: [
@if (permissions.WriteAccess)
{
@Html.GetGridCustomColumn(model => model.Id,"Edit"," ","EditLink",18) @:,
@*@Html.GetGridCustomColumn(model => model.Id,"Delete"," ","DeleteLink",18)*@
}
@Html.GetGridCustomColumn(model => model.Id, "Details", " ", "DetailLink", 18),
@Html.GetGridColumn(model => model.LicenceNumber),
@Html.GetGridColumn(model => model.EntityName),
@Html.GetGridColumn(model => model.EntityTypeName),
@Html.GetGridColumn(model => model.StartDate),
@Html.GetGridColumn(model => model.EndDate),
@Html.GetGridColumn(model => model.LicenceStatus),
@Html.GetGridColumn(model => model.LicenceType),
@Html.GetGridColumn(model => model.LicenseApplicationStatus)
]
}).jQuery('#GridList').jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false }),
jQuery("#GridList").navGrid('#pager', { edit: true, add: true, del: false });
afterComplete: function (response,postdata) {
alert("new record added");
};
});
afterCompleate是表单编辑事件,而不是Grid事件。 您可以使用afterCompleate作为添加事件:
$("#list").jqGrid({
// jqGrid options
}).jqGrid('navGrid', '#pager', {/*navGrid options*/}, {/*Edit optoins*/}, {
/*Add options:*/
afterComplete: function (response, postdata) {
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.