1

我在 Jqgrid 中使用内联导航。当数据有效时,我正在通过数据库验证网格,我的行已保存。但是当数据无效时,我想将网格保持在编辑模式,所以请给我建议。

@Oleg

jQuery("#voucherGrid").jqGrid('inlineNav',"#pager", {
        addParams: {
            useDefValues: true,
            addRowParams: {
                keys: true,
                extraparam: { 
                    Voucher_Type: function(){                                   
                        return $('#vaoucherTypeSel').val();
                    }
                },
                successfunc : function(response,id){
                    $('.modal-body').text(response.responseText);
                    $('#myModal').modal('show');

                    if(response.responseText.length < 8){

                    }else{
                        var myGrid = $('#voucherGrid');
                        selRowId = myGrid.jqGrid ('getGridParam', 'selrow');
                        myGrid.jqGrid('editRow',selRowId);
                        $('#voucherGrid_ilsave').removeClass('ui-state-disabled');
                        $('#voucherGrid_ilcancel').removeClass('ui-state-disabled');
                        $('#voucherGrid_iladd').addClass('ui-state-disabled');
                    }
                }
            }
        },
        editParams : {
             keys: true,
            extraparam : {
                Voucher_Type : function(){                                  
                    return $('#vaoucherTypeSel').val();
                }
            },
            successfunc : function(response){
                $('.modal-body').text(response.responseText);
                $('#myModal').modal('show');
                if(response.responseText.length < 8){

                }else{          
                    var myGrid = $('#voucherGrid');
                    selRowId = myGrid.jqGrid ('getGridParam', 'selrow');
                    myGrid.jqGrid('editRow',selRowId);
                    $('#voucherGrid_ilsave').removeClass('ui-state-disabled');
                    $('#voucherGrid_ilcancel').removeClass('ui-state-disabled');
                    $('#voucherGrid_iladd').addClass('ui-state-disabled');
                }
            }
        },    
        add: true,edit: false, save: true,  cancel: true,
        reloadAfterSubmit: false,
    });

我的代码有什么问题?

4

0 回答 0