关键代码:(如插入按钮插入行以前判断gird是否为编辑状态)

$('#btnIns').click(function (event) {
                if ($("#tbPaymentTerm_iledit").hasClass("ui-state-disabled")) {  //tbPaymentTerm为Grid绑定ID;tbPaymentTerm_iledit为Grid编辑行编辑按钮的ID;ui-state-disabled为编辑行编辑按钮样式
                    $.jAlert("please save the record.");
                    $("body").jLoading("destroy");
                    return false;
                }//模拟Grid编辑状态
                $("#tbPaymentTerm").jqGrid('addRow');
                event.preventDefault();
                event.stopPropagation(); 
                //保存代码
                //$("#tbPaymentTerm").jqGrid('saveRow',$("#" + gridID).jqGrid('getGridParam', 'selrow'));
            });

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-12-17
  • 2021-07-26
相关资源
相似解决方案