Reputation: 1013
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.
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;
Upvotes: 3
Views: 6227
Reputation: 57
If you are using valueFormatter
, comparator
or other grid option functions please add a debugger on those functions and check for errors.
I also faced a similar kind of situation and the error was occurring in the comparator function and it was not visible in the browser console.
Upvotes: 1
Reputation: 21
I faced a similar issue. Please try to add the below changes in your css/scss file.
.ag-group-value {
display: inline-flex;
}
Upvotes: 1
Reputation: 30088
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
Upvotes: 1