0
votes

I am working with Ag-Grid version 21.1.0 and Angular 8. I am trying row-grouping in ag-grid following the tutorial: https://www.ag-grid.com/javascript-grid-grouping/ I have a field in my data-model as "Short Name" field and I am trying to group by this field by setting "rowGroup"="true" property of corresponding column-def object. A new column called "Group" is created in the Ag-grid but the values for this newly created column are not displayed by the grid.enter image description here I am using server side filtering and sorting for the grid and using rowmodeltype="infinite". Kindly help me where I am going wrong.

Update: I am creating a list of column Metadata Objects dynamically. For the specific column by which I want to group the data, I am setting the following attributes:

  columnMetaObj.rowGroup = true;
  columnMetaObj.enableRowGroup = true;
  columnMetaObj.hide = true;

then finally I am setting grid options as follows:

    this.gridOptions.columnDefs = this.gridColDataInput.columnDefs;
    this.gridOptions.rowModelType = 'infinite';
    this.gridOptions.cacheBlockSize = 100;
    this.gridOptions.paginationPageSize = 100;
1
Can you show the code that will be helpful to understand what you are doing? - cedverd
I have updated the question - A_J
did you find any solution for this issue? - Kushal Sethi
No I haven't found - A_J

1 Answers

0
votes

The behavior that you describe is the default behavior for the grid. To keep the columns visible when they are added to a group, specify suppressDragLeaveHidesColumns=true in your gridOptions.

This is documented part-way down the page at the link that you referenced, along with an example, at https://www.ag-grid.com/javascript-grid-grouping/#keepingColumnsVisible