Author Topic: Group Panel - Show/Hidden  (Read 2524 times)

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 148
    • View Profile
Group Panel - Show/Hidden
« on: May 07, 2019, 03:25:36 pm »
Hello,

I have presented the features on this page to the users in a separate pop-up window.

I wanted to add this to "group panel".

https://paramquery.com/pro/demos/grid_parts

Add Javascript Code
Code: [Select]
$("#grid_groupModel").change(function (evt) {
grid.option("groupModel",$(this).prop("checked"));
grid.refresh();
}).attr("checked", grid.option("groupModel.on"));

Add Html Code
Code: [Select]
    <label><input type="checkbox" id="grid_groupModel">
    Grup Panel </label>
    <br>

Console Error:
Code: [Select]
Uncaught use groupOption() to set groupModel options.

Why is the error caused? Can you help me?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Group Panel - Show/Hidden
« Reply #1 on: May 07, 2019, 06:23:54 pm »
Which version of grid are you using?

Grouping can be turned on/off with help of groupModel.on

Ex: please check toggle button in this example: https://paramquery.com/pro/demos/group_rows
« Last Edit: May 07, 2019, 06:26:29 pm by paramquery »

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 148
    • View Profile
Re: Group Panel - Show/Hidden
« Reply #2 on: May 09, 2019, 05:41:05 am »
Changed the javascript code as in the example. Thanks.

Code: [Select]
$("#grid_groupModel").change(function (evt) {
          grid.Group().option({on: $(this).prop("checked")});
          grid.refresh();
}).attr("checked", grid.option("groupModel.on"));