Author Topic: Hide the first column in the column group when the group is expanded  (Read 245 times)

mikep

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 163
    • View Profile
The first column in my column group is a calculated column and I only want it to display when the column is collapsed.
Can you add the Javascript to this file so that the column "rollup" is hidden when the group is collapsed?

https://jsfiddle.net/ftjhrqum/

mikep

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 163
    • View Profile
Re: Hide the first column in the column group when the group is expanded
« Reply #1 on: October 04, 2024, 04:36:15 pm »
Sorry, to clarify, "rollup" should be hidden when expanded and the only column visible when collapsed.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: Hide the first column in the column group when the group is expanded
« Reply #2 on: October 04, 2024, 07:39:33 pm »
This is done by setting collapsible.last of parent to null and setting showifOpen of children columns as per your requirement.

Code: [Select]
title: "Level1", align: "center", collapsible: {last: null},
colModel: [
  {title: "rollup", dataindx:"mycalc", showifOpen: false},
  {title: "project", dataindx:"company", showifOpen: true},
{title: "rank", dataindx:"rank",showifOpen: true}
]
},

https://jsfiddle.net/3jamf6x7/

PS: version of pqgrid is quite old in the jsfiddle.