【问题标题】:Inline Nav addRow method for jQGrid TreeGrid not working properlyjQGrid TreeGrid 的内联导航 addRow 方法无法正常工作
【发布时间】:2012-08-05 10:23:50
【问题描述】:

我正在尝试为 jqGrid Treegrid 使用内联导航“添加新行”功能,但到目前为止我无法正确配置它。我已经阅读了相关的文档和其他帖子,但没有任何效果。 我已经为 addRow 设置了选项,但是当我单击添加行图标时,会在网格中添加一个新行并弹出错误“未捕获的 TypeError:无法读取 null jquery.jqGrid.src.js 的属性'长度': 8963″。对此有什么想法吗?我已经成功配置了内联编辑,它对我来说工作正常,但内联添加没有按预期工作。

我检查了jqgrid src,错误出现在这个sn-p中

if (treeg) { $("span:first",this).html(""); }
else { $(this).html(""); }
var opt = $.extend({},cm[i].editoptions || {},{id:rowid+"_"+nm,name:nm});
if(!cm[i].edittype) { cm[i].edittype = "text"; }
if(tmp == " " || tmp == " " || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}

此代码正在列中查找 span,但是当我通过 firebug 检查该列时,该列的标记中没有呈现 span 标签

对此有什么想法吗?

【问题讨论】:

    标签: jquery jquery-plugins jqgrid jqgrid-inlinenav


    【解决方案1】:

    我认为我面临的问题是由于当前 jQGrid 树网格限制here 的限制,"addRowData" 在树网格模式下不受支持。 对于内联行添加,"this method uses two already constructed methods. When calling the method first executes the addRowData method which add a local row. After this the method call editRow method to edit the row" 来自 inline edit add row documentation

    由于树网格不支持"addRowData",因此jqGrid树网格也不支持内联添加行。 jqGrid文档中的限制列表,需要更新

    【讨论】:

    • 您确认了吗?你找到解决方法了吗?我目前面临完全相同的问题。
    • 是的,我当时做过,但那是两年前的事了。我最近没有查 JqGrid,可能他们在较新的版本中包含了这个东西。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-16
    • 2016-08-15
    • 2012-09-26
    • 2016-06-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多