Bug in addRowData Method – Guriddo https://guriddo.net/?topic=bug-in-addrowdata-method&feed=rss2 Sat, 01 Nov 2025 06:55:33 +0000 https://bbpress.org/?v=2.6.14 en-US https://guriddo.net/?topic=bug-in-addrowdata-method#post-103657 <![CDATA[Bug in addRowData Method]]> https://guriddo.net/?topic=bug-in-addrowdata-method#post-103657 Fri, 12 Dec 2014 12:00:30 +0000 greg.valainis@pa-tech.com EDIT: bad at english and missing ‘;’ after the ‘sind = sind.rowIndex + addin’ statement

I believe I have found a bug in the addRowData method.  The bug occurs when using the method with pos = “after” and a subgrid exists below the row you are attempting to insert after.  First off, when inserting ‘row’ the .join(”) method is not used.  Second off, the ‘sind’ is incremented incorrectly.  In this case it should be incremented by two, but it is only incremented by one.  Here is a jsFiddle link to my code:

http://jsfiddle.net/mzrLeqqe/1/

Used jsFiddle since I didn’t really try to make the code formatted in this post. Â Below is a hard copy.

case ‘after’:
sind = $(t).jqGrid(‘getGridRowById’, src);
if (sind) {
var addin = 1;
if ($(t.rows[sind.rowIndex + 1]).hasClass(“ui-subgrid”)) { $(t.rows[sind.rowIndex + 1]).after(row.join(”)); addin++; }
else { $(sind).after(row.join(”)); }
sind = sind.rowIndex + addin;
}
break;

Hope this helps.

I believe the version I was using version 4.6 when I discovered this, but it appeared version 4.7 did not have this fixed.

]]>
https://guriddo.net/?topic=bug-in-addrowdata-method#post-103659 <![CDATA[Reply To: Bug in addRowData Method]]> https://guriddo.net/?topic=bug-in-addrowdata-method#post-103659 Fri, 12 Dec 2014 12:01:47 +0000 OlegK Hi Greg,

I created the pull request based on your bug report.

Best regards
Oleg

]]>