Author Topic: groupModel works when toggling Grouping  (Read 2209 times)

mercury85

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 58
  • ASP.NET, VB.NET, MVC, JS, C#, VBA, SQL, MDX, DAX
    • View Profile
groupModel works when toggling Grouping
« on: May 15, 2018, 10:56:44 am »
Hi,

Working more on the calls from IndexDB and now, I have created my colModel dynamically and everything looks good,  I am having some issues with the groupmodel not initializing unless I push toggl on/off, At the end I add the group model and refreshviewanddata hoping it refreshes but no luck.


  var groupModel = {
        on: true,
        indent: 20,
        dataIndx: dataIndx,
        summaryInTitleRow: "all",
        grandSummary: true,
        showSummary: [],
        summaryEdit: false,
        titleInFirstCol: true,
        bold: true,
        collapsed: [false, false, false, true],
        title: ['{0}', '{0}', '{0}', '{0}']
    };


   var grid = pq.grid("#grid_group_rows", obj);
    grid.colModel = buildColM;
    grid.Group().option(groupModel);
    console.log(groupModel);
    grid.refreshDataAndView();

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: groupModel works when toggling Grouping
« Reply #1 on: May 15, 2018, 11:36:01 am »
Please share a jsfiddle of the issue.

In your code, following line is incorrect, it's not part of the grid API.

Code: [Select]
grid.colModel = buildColM;

Please use the grid API https://paramquery.com/pro/api#method-refreshCM

mercury85

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 58
  • ASP.NET, VB.NET, MVC, JS, C#, VBA, SQL, MDX, DAX
    • View Profile
Re: groupModel works when toggling Grouping
« Reply #2 on: May 15, 2018, 11:55:45 am »
Perfect thank you!!!