How to implement Master-Detail component in the community edition of the ag-grid

Viewed 2155

I want to implement ag-grid Master Detail feature.However it is an enterprise level feature and i am currently using community version and due to some constraints my organization does not want to purchase the license .Is there any other way to achieve this?Thank you in advanced.

2 Answers

Try add this options to your colDef:

gridOptions= {
   fullWidthCellRendererFramework: RowDetailsRendererComponent,
   isFullWidthCell: (rowNode: RowNode) => rowNode.flower,
   doesDataFlower: (data: any) => true,
   embedFullWidthRows: true
}

Where RowDetailsRendererComponent have to implements AgRendererComponent class

and have to contain child ag-grid for example

@Component({
  template: '<ag-grid ...></ag-grid>' // child grid
})
export class RowDetailsRendererComponent implements AgRendererComponent {
  agInit(params): void {}
  refresh(params: any): boolean {}
}

This code allows you to replace a row by the content of a component. A solution for the initial problem could be in my opinion use this code with a "frameworkComponent" to implement the expand/collapse button. You can check how to use add a button to a ag-Grid here: Example to add a botton to a cell in ag-Grid

Related