Author Topic: Grouping on, but no grouping by default  (Read 457 times)

mikep

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 163
    • View Profile
Grouping on, but no grouping by default
« on: November 12, 2022, 01:03:31 am »
How do I turn on grouping, but leave grid ungrouped by default?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Grouping on, but no grouping by default
« Reply #1 on: November 13, 2022, 04:04:59 pm »
Initially keep groupModel.on to false

Later on after initialization to turn on the grouping:

Code: [Select]
  grid.Group().option({on: true });

mikep

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 163
    • View Profile
Re: Grouping on, but no grouping by default
« Reply #2 on: November 17, 2022, 06:33:07 pm »
The 2nd line doesn't error out when false, but when I set this to true, I get the error below. The screenshot shows other failed attemps.
                $gridMain = $("#gridMain").pqGrid(obj);
                $gridMain.pqGrid("Group").option({ on: true });


Uncaught TypeError: Cannot set properties of undefined (setting '_renderG')
    at pqgrid.min.js:55:23971
    at n.cGroup.refreshColumns (pqgrid.min.js:55:26651)
    at n.cGroup.setOption (pqgrid.min.js:55:27277)
    at n.cGroup.option (pqgrid.min.js:55:23032)
    at n.cGroup.option (pqgrid.min.js:75:31142)
    at BuildRPMGrid (ResourceEdit.aspx:311:43)
    at Object.success (ResourceEdit.aspx:227:25)
    at i (jquery-2.2.4.min.js:2:27151)
    at Object.fireWith [as resolveWith] (jquery-2.2.4.min.js:2:27914)
    at z (jquery-2.2.4.min.js:4:12059)
« Last Edit: November 17, 2022, 06:47:51 pm by mikep »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Grouping on, but no grouping by default
« Reply #3 on: November 18, 2022, 06:43:11 am »
Please define the groupModel option but leave the groupModel.on sub-option to false initially.

Kindly share a jsfiddle if you are still facing errors.