Inline Nav addRow method for jQGrid TreeGrid not working properly

1.4k views Asked by At

I'm trying to use the inline Nav "add new row" functionality for a jqGrid Treegrid, and so far i'm not able to configure it properly. I've read the documentation and other posts related to it but nothing is working. I've set the options for addRow but when I click the add row icon, a new row is added in the grid and an error pops out "Uncaught TypeError: Cannot read property 'length' of null jquery.jqGrid.src.js:8963″. Any thoughts on this? I've successfully configured the inline edit and it's working fine for me but inline add is not working as expected.

I've checked the jqgrid src, the error comes in this snippet

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='';}

This code is looking for span in the column but when I checked the column through firebug, there is no span tag rendered in the markup of that column

Any thoughts on this?

1

There are 1 answers

2
Kamran Ali On BEST ANSWER

I think the issue i'm facing is due to the fact that according to current limitations of jQGrid tree grid limitations here, "addRowData" is not supported in tree grid mode. For inline row add, "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" from inline edit add row documentation.

So as "addRowData" is not supported for tree grid,hence inline add row is also not supported for jqGrid tree grid. The limitation list at the jqGrid documentation, needs to be updated