Skip to content

Commit

Permalink
fix: allow meta data to header via callback (#2475)
Browse files Browse the repository at this point in the history
This will be helpful to add more meta data to headers.
  • Loading branch information
gargroh authored Aug 3, 2020
1 parent c591ec1 commit 90bf5c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function decorateColumn(column, userDefaultColumn) {
}

// Build the header groups from the bottom up
export function makeHeaderGroups(allColumns, defaultColumn) {
export function makeHeaderGroups(allColumns, defaultColumn, additionalHeaderProperties = () => ({})) {
const headerGroups = []

let scanColumns = allColumns
Expand Down Expand Up @@ -120,6 +120,7 @@ export function makeHeaderGroups(allColumns, defaultColumn) {
originalId: column.parent.id,
id: `${column.parent.id}_${getUID()}`,
headers: [column],
...additionalHeaderProperties(column),
}
} else {
// If other columns have parents, we'll need to add a place holder if necessary
Expand All @@ -130,6 +131,7 @@ export function makeHeaderGroups(allColumns, defaultColumn) {
id: `${column.id}_placeholder_${getUID()}`,
placeholderOf: column,
headers: [column],
...additionalHeaderProperties(column),
},
defaultColumn
)
Expand Down

0 comments on commit 90bf5c2

Please sign in to comment.