ParamQuery grid support forum

General Category => Help for ParamQuery Grid (free version) => Topic started by: tarunsharma on December 12, 2020, 04:16:27 am

Title: Expand or Collapse Grid rows on button click
Post by: tarunsharma on December 12, 2020, 04:16:27 am
I need to add Expand And Collapse button on the header of the pqgrid

For Example - Expand All :- That is expand all the rows of the grid all together.
Collapse All :- To collapse all the rows.

Can you suggest the best possible way to implement this functionality.

Thanks




Title: Re: Expand or Collapse Grid rows on button click
Post by: tarunsharma on December 15, 2020, 01:53:18 am
Can anyone from the support team help me to expand all the rows on button click?
Title: Re: Expand or Collapse Grid rows on button click
Post by: paramvir on December 15, 2020, 09:59:55 pm
To exapand / collapse all row details, iterate through all rows and apply show: true /false to pq_detail property of rowData

Code: [Select]
grid.pageData().forEach(function(rd){
rd.pq_detail = {show: true/false};
})
grid.refresh()
Title: Re: Expand or Collapse Grid rows on button click
Post by: tarunsharma on December 16, 2020, 01:14:25 am
It is working on the very first click. If I collapse few rows and click expand button again it will not work.
Title: Re: Expand or Collapse Grid rows on button click
Post by: tarunsharma on December 16, 2020, 09:38:00 pm
not able to click Expand All button second time. Can anyone help?