【问题标题】:jqGrid - how to return result of row edit?jqGrid - 如何返回行编辑的结果?
【发布时间】:2014-09-12 16:56:54
【问题描述】:

我正在尝试使用内联编辑器编辑一行,如下所示:

ondblClickRow: function(rowid) {
        jQuery(this).jqGrid('editGridRow', rowid,
           {width:500,Height:400,recreateForm:true,closeAfterEdit:true,
            closeOnEscape:true,reloadAfterSubmit:true,
              editData: {
                 SubjId: $( "#list0" ).jqGrid ( 'getCell', rowid, 'SubjId' ),
                 a: 1,
                 SeqId: $( "#list0" ).jqGrid ( 'getCell', rowid, 'SequenceId' )
              },
              afterSubmit: function( response, postData )
              {
                  alert( response.responseText );
              }
        });

Editor 在 jqGrid 定义中定义为 'editurl: '

两个问题:

  1. php 代码正在从网格对话框获取编辑请求,但我不清楚如何返回结果。

  2. 尝试使用简单的 echo 0 返回(许多 Ajax 请求就是这种情况),但 jqgrid 代码中出现错误:

文件 jquery.jqGrid.src.js 第 7936 行:“未捕获的类型错误:无法读取未定义的属性 '0'”。

jqGrid 来自//cdn.jsdelivr.net/jqgrid/4.6.0/

关于如何进行的建议?

【问题讨论】:

    标签: jquery jqgrid


    【解决方案1】:

    您应该从afterSubmit 回调中返回数组。在afterSubmit 的末尾添加例如return [true]; 以解决问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多