I need to show comma separated by array values for column ‘category’ in grid. When we try to group category column, instead of just grouping with comma separated values, need to display unique category followed by respective category data under it.
columnDefs = [
{ headerName: 'Category', field: 'category' },
{ headerName: 'Product', field: 'product' },
{ headerName: 'Price', field: 'price' }
];
categoryList = ['Clothing', 'Electronics', 'Sports', 'Furniture'];
// Initial row data before transformation
rowData = [
{ category: ['Electronics', 'Furniture'], product: 'Laptop', price: 1000 },
{ category: ['Electronics'], product: 'Phone', price: 500 },
{ category: ['Furniture'], product: 'Sofa', price: 300 },
{ category: ['Clothing', 'Electronics', 'Sports'], product: 'Shirt', price: 40 },
{ category: ['Clothing', 'Sports'], product: 'Football', price: 20 }
];
For Example while grouping Category:
- Electronics
- Row1
- Row2
- Row4
Is it possible to show with custom grouping in Client Side Rendering AG GRID?
https://plnkr.co/edit/5O9T9g29pbYazoKL?open=app.component.ts