Skip to content

HeaderCellContext

Context passed to headerRenderer for complete control over header cell content. When using this, you control the header content. Resize handles are added automatically for resizable columns.

headerRenderer: (ctx) => {
const div = document.createElement('div');
div.className = 'custom-header';
div.innerHTML = `<span>${ctx.value}</span>`;
// Optionally include sort icon
const sortIcon = ctx.renderSortIcon();
if (sortIcon) div.appendChild(sortIcon);
return div;
}
PropertyTypeDescription
columnColumnConfig<TRow>Column configuration reference.
valuestringThe header text (from column.header or column.field).
sortStatedesc | asc | unknownCurrent sort state for this column.
filterActivebooleanWhether the column has an active filter.
cellElHTMLElementThe header cell DOM element being rendered into.
renderSortIcon() => HTMLElement | unknownRender the standard sort indicator icon. Returns null if column is not sortable.
renderFilterButton() => HTMLElement | unknownRender the standard filter button. Returns null if FilteringPlugin is not active or column is not filterable. Note: The actual button is added by FilteringPlugin’s afterRender hook.
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