Author Topic: Expand/Collapse rows dynamically in a group model / tree grid  (Read 401 times)

Digitalsoft

  • Pro OEM
  • Newbie
  • *
  • Posts: 49
    • View Profile
Hi Team,
Is it possible in pq grid to expand/collpase rows dynamically either in group model /tree grid having the button at the grid header.
ex:
see in the pic collpase.png , I am having + button in the header customer, master lf, and localfamily and all the first 4 columns are under groupmodel.
when I click on + button in the master lf header , the rows should expand as in the expand.png, i.e rows should expand upto masterlf column
similarly when I click on + button in the local family header ,  rows should expand upto localfamily column.

Is it possible to have this structure in pq grid. Please let me know

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: Expand/Collapse rows dynamically in a group model / tree grid
« Reply #1 on: July 18, 2023, 11:45:27 am »
Yes it's possible with pqgrid,

1) use column.title callback function to add an icon in the header cell.

https://paramquery.com/pro/api#option-column-title

2) use headerCellClick event to detect click on icon in header cell.

https://paramquery.com/pro/api#event-headerCellClick

3) use grid.Group().collapse and expand API to collapse and expand the grouping levels

https://paramquery.com/pro/api#method-Group

Digitalsoft

  • Pro OEM
  • Newbie
  • *
  • Posts: 49
    • View Profile
Re: Expand/Collapse rows dynamically in a group model / tree grid
« Reply #2 on: July 19, 2023, 11:33:11 am »
But regarding point 3, Before expand/ collapse a particular node how to identify whether the node is in collapsed or expanded state?