diff --git a/.changeset/header-get-is-pinned.md b/.changeset/header-get-is-pinned.md new file mode 100644 index 0000000000..2d08d9968e --- /dev/null +++ b/.changeset/header-get-is-pinned.md @@ -0,0 +1,5 @@ +--- +'@tanstack/table-core': minor +--- + +Add `header.getIsPinned()`, which reads the pinned region of a header's own leaf columns. A group column split across pinned regions renders one header per region, and `header.column.getIsPinned()` reported the same region for all of them (#4906). diff --git a/docs/framework/alpine/guide/column-pinning.md b/docs/framework/alpine/guide/column-pinning.md index e82ae63317..633839eeb7 100644 --- a/docs/framework/alpine/guide/column-pinning.md +++ b/docs/framework/alpine/guide/column-pinning.md @@ -140,6 +140,7 @@ There are a handful of useful Column API methods to help you implement column pi - `column.getCanPin`: Use to determine if a column can be pinned. - `column.pin`: Use to pin a column to the start or end. Or use to unpin a column. - `column.getIsPinned`: Use to determine where a column is pinned. +- `header.getIsPinned`: Use to determine where a header is pinned. A group header split across pinned regions reports the region it is rendered in, which `header.column.getIsPinned` cannot. - `column.getPinnedIndex`: Use to read the column's index within its pinned column group. - `column.getStart`: Use to provide the correct `start` CSS value for a pinned column. - `column.getAfter`: Use to provide the correct `end` CSS value for a pinned column. @@ -214,19 +215,16 @@ Because Alpine does not initialize directives inside content set with `x-html`,