Can anyone explain what header.isPlaceholder() is doing? #4828
-
Across all the examples provided in the documentation, header.isPlaceholder() is called when building the table headers. The docs refer to this as a check to see if a header is a "placeholder header". However, there is no mention of how to create a placeholder header anywhere in the docs. This line of code is showing as uncovered code in my test runner across all of my apps using tanstack table. I'd like to just remove it, but if I knew how to create a placeholder header, I can just write a test and get that covered. Can anyone help? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
+ 1 The secret is lay down here if (isLeafHeader && headerToGroup.column.parent) {
// The parent header is new
column = headerToGroup.column.parent
} else {
// The parent header is repeated
column = headerToGroup.column
isPlaceholder = true
} I suppose, it is related with grouping the headers, and it is an internal mechanism of the react-table, you don't need to set it explicitly. Someone can explain better, that is my comment from the reading of the code. |
Beta Was this translation helpful? Give feedback.
+ 1
The secret is lay down here
I suppose, it is related with grouping the headers, and it is an internal mechanism of the react-table, you don't need to set it explicitly. Someone can explain better, that is my comment from the reading of the code.