Asp.net mvc 4 内联编辑后发生的事件

Asp.net mvc 4 内联编辑后发生的事件,asp.net-mvc-4,jqgrid,jqgrid-asp.net,Asp.net Mvc 4,Jqgrid,Jqgrid Asp.net,我有jqgrid,它在选择行时将行的数据发送到另一个视图(MVC4)。但当我编辑行的信息时(我使用的是内联编辑),这个视图并没有改变。我找不到内联编辑后发生的事件。这是js,行编辑后我应该更改什么来更改视图 $(function () { $("#GridTable").jqGrid({ url: "/Goods/GoodsList", editurl: "/Goods/Edit", datatype: 'json', mtype: 'Get', co

我有jqgrid,它在选择行时将行的数据发送到另一个视图(MVC4)。但当我编辑行的信息时(我使用的是内联编辑),这个视图并没有改变。我找不到内联编辑后发生的事件。这是js,行编辑后我应该更改什么来更改视图

  $(function () {
$("#GridTable").jqGrid({
    url: "/Goods/GoodsList",
    editurl: "/Goods/Edit",
    datatype: 'json',
    mtype: 'Get',
    colNames: ['GoodId', 'Имя', 'Цена'],
    colModel: [
        { key: true, hidden: true, name: 'GoodId', index: 'GoodId', editable: true },
        {
            key: false, name: 'GoodName', index: 'GoodName', editable: true, sortable: true,
            editrules: {
                required: true, custom: true, custom_func: notATag
            }
        },
        {
            key: false, name: 'Price', index: 'Price', editable: true, sortable: true, formatter: numFormat,
            unformat: numUnformat,
            //sorttype: 'float',
            editrules: { required: true, custom: true, custom_func: figureValid}
        }, ],
    pager: jQuery('#pager'),
    rowNum: 10,
    rowList: [10, 25, 50, 100],
    height: '100%',
    viewrecords: true,
    caption: 'Список товаров',
    sortable: true,
    emptyrecords: 'No records to display',
    cellsubmit : 'remote',
    jsonReader: {
        root: "rows",
        page: "page",
        total: "total",
        records: "records",
        repeatitems: false,
        Id: "0"
    },
    //to get good's full view when row is selected
    onSelectRow:

        function () {
            var myGrid = $('#GridTable'),
            selRowId = myGrid.jqGrid('getGridParam', 'selrow'),
            celValue = myGrid.jqGrid('getCell', selRowId, 'GoodId');
            $.ajax({
                url: "/Goods/DetailInfo",
                type: "GET",
                data: { id: celValue }
            })
            .done(function (partialViewResult) {
                $("#goodDetInfo").html(partialViewResult);
            });
        },
    //to change good's full view after row deleting
    loadComplete: function(data){
        var myGrid = $('#GridTable'),
            selRowId = myGrid.jqGrid('getGridParam', 'selrow'),
            celValue = myGrid.jqGrid('getCell', selRowId, 'GoodId');
        $.ajax({
            url: "/Goods/DetailInfo",
            type: "GET",
            data: { id: celValue }
        })
        .done(function (partialViewResult) {
            $("#goodDetInfo").html(partialViewResult);
        });
    },
    autowidth: true,
    multiselect: false
}).navGrid('#pager', { edit: false, add: true, del: true, search: false, refresh: true },
    {
        // edit options
        zIndex: 100,
        url: '/Goods/Edit',
        closeOnEscape: true,
        closeAfterEdit: true,
        recreateForm: true,
        afterComplete: function (response) {
            if (response.responseText) {
                alert(response.responseText);
            }
            var myGrid = $('#GridTable'),
            selRowId = myGrid.jqGrid('getGridParam', 'selrow'),
            celValue = myGrid.jqGrid('getCell', selRowId, 'GoodId');
            $.ajax({
                url: "/Goods/DetailInfo",
                type: "GET",
                data: { id: celValue }
            })
            .done(function (partialViewResult) {
                $("#goodDetInfo").html(partialViewResult);
            });
        }
    },
    {
        // add options
        zIndex: 100,
        url: "/Goods/Create",
        closeOnEscape: true,
        closeAfterAdd: true,

        afterComplete: function (response) {
            if (response.responseText) {
                alert(response.responseText);
            }
        }
    },
    {
        // delete options
        zIndex: 100,
        url: "/Goods/Delete",
        closeOnEscape: true,
        closeAfterDelete: true,
        recreateForm: true,
        msg: "Are you sure you want to delete this task?",
        afterComplete: function (response) {
            if (response.responseText) {
                alert(response.responseText);
            }
        }
    });

$('#GridTable').inlineNav('#pager', {
    edit: true,
    add: false,
    del: false,
    cancel: true,
    editParams: {
        keys: true,
        afterSubmit: function (response) {
            if (response.responseText) {
                alert(response.responseText);
            }
            var myGrid = $('#GridTable'),
            selRowId = myGrid.jqGrid('getGridParam', 'selrow'),
            celValue = myGrid.jqGrid('getCell', selRowId, 'GoodId');
            $.ajax({
                url: "/Goods/DetailInfo",
                type: "GET",
                data: { id: celValue }
            })
            .done(function (partialViewResult) {
                $("#goodDetInfo").html(partialViewResult);
            });
        }
    },
});

}))

可以找到
inlineav
editParams
参数的属性和回调函数。您需要的可能是
aftersavefunc
successfunc
,而不是
afterSubmit
,后者仅存在于表单编辑方法中(请参阅)。对
aftersavefunc
successfunc
回调的参数进行了描述(作为
saveRow
的参数),但这些参数取决于您使用的jqGrid版本以及jqGrid的分支(,商业版或版本中的旧jqGrid可以找到
InlineAV
editParams
参数的属性和回调函数。您需要的可能是
aftersavefunc
successfunc
,而不是
afterSubmit
,它们仅存在于表单编辑方法中(请参阅).aftersavefunc或successfunc回调的参数(作为
saveRow
的参数)进行了描述,但这些参数取决于您使用的jqGrid版本以及jqGrid的分支(、商业版或旧版本的jqGrid)