ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: luckduck on May 11, 2020, 01:42:17 pm

Title: Add rows while grouping
Post by: luckduck on May 11, 2020, 01:42:17 pm
Hi Paramvir,


In the example below, if you select the 4th row and add a row, it is added to the 8th row.

How to add new row after selected cell/row in group

https://jsfiddle.net/uzqj1mwv/ (https://jsfiddle.net/uzqj1mwv/)

Thank you
Title: Re: Add rows while grouping
Post by: paramvir on May 11, 2020, 03:08:24 pm
Thanks for your question.

Rows are not to be added in row grouping view with addRow method.

Please use Group() API ( addNodes, deleteNodes, moveNodes methods ) to add, remove or move rows while grouping.

https://paramquery.com/pro/api#method-Group
Title: Re: Add rows while grouping
Post by: luckduck on May 14, 2020, 11:56:58 am
I am trying to add rows using addNodes, but I can't find a solution. thank you for your help

https://jsfiddle.net/xr5pLen9/ (https://jsfiddle.net/xr5pLen9/)
Title: Re: Add rows while grouping
Post by: paramvir on May 14, 2020, 03:58:05 pm
Hope this helps:

Code: [Select]
       var Group = this.Group(),
             parent = Group.getParent(selRow),
             indx = Group.getChildren(parent).indexOf(selRow);
 
       Group.addNodes([newData], parent, (indx + 1));

https://jsfiddle.net/1sq9Lckm/