Ashutosh Kumar
Ashutosh Kumar

Reputation: 471

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

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.

Upvotes: 4

Views: 4338

Answers (2)

Ricardo Magalhães
Ricardo Magalhães

Reputation: 227

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

Upvotes: 0

Yevhen Oliinyk
Yevhen Oliinyk

Reputation: 121

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 {}
}

Upvotes: 2

Related Questions