0

I am trying to highlight a new inserted record in jqgrid tried this link

but afterCompleate does not fire, tried gridview: false with no luck, using mvc 4 and jqgrid version 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","&nbsp;","EditLink",18) @:,
            @*@Html.GetGridCustomColumn(model => model.Id,"Delete","&nbsp;","DeleteLink",18)*@
        }
            @Html.GetGridCustomColumn(model => model.Id, "Details", "&nbsp;", "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");
    };

});

Community
  • 1
  • 1
pramod
  • 11
  • 1
  • 4

1 Answers1

0

afterCompleate is form editing event, not actually Grid event. You can use afterCompleate as add event:

$("#list").jqGrid({
    //  jqGrid options
}).jqGrid('navGrid', '#pager', {/*navGrid options*/}, {/*Edit optoins*/}, {
    /*Add options:*/
    afterComplete: function (response, postdata) {

    }
});
alxv
  • 115
  • 2
  • 8