0

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:

  1. 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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.