JavaScript Data Grid

Master / Detail - Master Rows

javascript logo

Master Rows are the rows inside the Master Grid that can be expanded to display Detail Grids.

Static Master Rows

Once a Master Grid is configured with masterDetail=true, all rows in the Master Grid behave as Master Rows, in that they can be expanded to display Detail Grids.

const gridOptions = {
    // by itself, all rows will be expandable
    masterDetail: true,

    // other grid options ...

Because Static Master Rows are used in all the basic examples of Master / Detail, another example is not given here.

Dynamic Master Rows

Dynamic Master Rows allows specifically deciding what rows in the Master Grid can be expanded. This can be useful if, for example, a Master Row has no child records, then it may not be desirable to allow expanding the Master Row.

To specify which rows should expand, provide the grid callback isRowMaster. The callback will be called once for each row. Return true to allow expanding and false to disallow expanding for that row.