ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: Jignesh on May 12, 2020, 09:15:30 am

Title: Collapse/Expand row in Grid based on hide/show rows
Post by: Jignesh on May 12, 2020, 09:15:30 am
Hi Paramvir,

I have created fiddle demo for Collapse/Expand row in Grid.

https://jsfiddle.net/cherishPatel/8jqys3e5/18/

If user click on Id 17 row's "Collapse" button then 18 and 19 Ids should be hide and button name changed "Expand'.
And click on Id 17 row's "Expand" button then 18,19 Ids should be show and button name changed to "Collapse".


Thank you,
Jignesh
Title: Re: Collapse/Expand row in Grid based on hide/show rows
Post by: paramvir on May 12, 2020, 10:57:55 am
Your use case closely resembles that of treegrid.

Please follow it rather than trying to reinvent the wheel.

https://paramquery.com/pro/demos/treegrid

And call the Tree() API methods collapseNodes, expandNodes from click of buttons.

https://paramquery.com/pro/api#method-Tree
Title: Re: Collapse/Expand row in Grid based on hide/show rows
Post by: Jignesh on May 12, 2020, 01:20:18 pm
Hi Paramvir,

We have required functionality base on collapse and Expand button on row level so tree functionality does not work for our case.

I have also added code on Prerender method, below URL for that https://jsfiddle.net/cherishPatel/8jqys3e5/28/

I have able to collapse and expand rows base on the row button. The only issue we have not able to change the button name or +/- sign.

Thank you,
Jignesh
Title: Re: Collapse/Expand row in Grid based on hide/show rows
Post by: paramvir on May 12, 2020, 07:07:00 pm
Quote
We have required functionality base on collapse and Expand button on row level so tree functionality does not work for our case.

Collapse and Expand buttons can be used instead of default node renderers in treegrid with help of column.render

Quote
I have able to collapse and expand rows base on the row button.

I don't see it working in your jsfiddle. Please use inbuilt Tree() API to expand / collapse rows instead of writing the logic from scratch.