Master Detail Grids

Summary

  • AdapTable fully supports the Master / Detail mode provided by AG Grid
  • It provides a dedicated Plugin which extends the functionality on offer

One of the most powerful features in AG Grid are Master Detail Grids.

These are grids where each row in the Master Grid can be expanded to display a Details grid.

AdapTable fully supports (and extends) AG Grid Master Detail grids.

It does so via a dedicated Plugin which provides extra features.

Primarily it enables all Detail Grids to share common AdapTable objects (e.g. Reports or Format Columns).

Installing Master Detail Plugin

Terminal
npm install @adaptabletools/adaptable-plugin-master-detail-aggrid

Caution

  • If using CommonJS, then install @adaptabletools/adaptable-plugin-master-detail-aggrid-cjs instead
  • Make sure also to include your License Key in the DetailOptions grid you provide

Unlike with Row Grouping, the Details Grid is a totally separate, fully configurable AdapTable instance.

Note

Each Details Grid contains its own set of columns and own unique data

This allows you essentially to provide 2 definitions:

  • the main Master Grid which provides the top level of rows
  • the Details Grid which will appear when a Master row is expanded
Deep Dive

Providing Details Grid Definition

It is possible to create a second Master / Detail grid as the child of an initial Master / Details grid.

Caution

Only one level of nesting Master / Details grids is possible

Master Detail
Fork
  • This demo illustrates how to use Master Detail Grids in AdapTable
  • The Master and Detail grids have different AdapTable configurations
  • However each Detail Grids shares the same Column Formatting on the GitHub Stars column

Expand to see how the Master Detail Grid was configured

Try It Out

Create a Format Column in one Details Grid and see it applied in the other 2

Initialising the Details Grid

AdapTable provides an onDetailInit property.

This contains a function that is invoked when a Details Grid is initialised.

Hint

You can use this property to provide bespoke configuration for the Details Grid at run-time

Deep Dive

onDetailInit property

Master Detail - Detail Init
Fork
  • This demo illustrates how to use onDetailInit to configure the Detail Grids in Master Detail Grids
  • The function calls the AdapTable API to close the Tool Panel (SideBar) in the Details Grid when it opens - but only if the Language is "JavaScript" or "TypeScript"

Expand to see how onDetailInit was used

Master Detail Plugin Options

PropertyDescription
detailAdaptableOptionsAdaptableOptions used in Detail Grids; all share same behaviour & State
onDetailInitFunction called when a Detail Grid is initialised, receives context including Adaptable Api

FAQ

I cannot export the Master-Details Grid? That is by design; Master-Detail Grids cannot be exported as a single export since the Detail "Grids" can be anything at all (however each Grid can be exported separately)