ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: mikep on November 12, 2022, 01:03:31 am

Title: Grouping on, but no grouping by default
Post by: mikep on November 12, 2022, 01:03:31 am
How do I turn on grouping, but leave grid ungrouped by default?
Title: Re: Grouping on, but no grouping by default
Post by: paramvir 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 });
Title: Re: Grouping on, but no grouping by default
Post by: mikep 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)
Title: Re: Grouping on, but no grouping by default
Post by: paramvir 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.