Skip to content

MasterDetailConfig

Configuration options for the master-detail plugin.

const grid = document.querySelector('tbw-grid');
grid.plugins = [
new MasterDetailPlugin({
detailRenderer: (row) => {
const el = document.createElement('div');
el.textContent = `Details for ${row.name}`;
return el;
},
detailHeight: 'auto',
expandOnRowClick: true,
animation: 'slide',
}),
];
PropertyTypeDescription
detailRenderer?(row: Record<string, unknown>, rowIndex: number) => string | HTMLElementRenderer function that returns detail content for a row
detailHeight?number | autoHeight of the detail row - number (pixels) or ‘auto’ (default: ‘auto’)
expandOnRowClick?booleanExpand/collapse detail on row click (default: false)
collapseOnClickOutside?booleanCollapse expanded detail when clicking outside (default: false)
showExpandColumn?booleanShow expand/collapse column (default: true)
animation?ExpandCollapseAnimationAnimation style for expanding/collapsing detail rows. - false: No animation - 'slide': Slide down/up animation (default) - 'fade': Fade in/out animation

Default: 'slide'


AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt