TreeTable: PassThrough (PT) Applies Only to Root — Internal DOM Structure Not Supported (v20.3) #4687
Unanswered
bageerathan-pandian
asked this question in
PrimeNG
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team,
I'm facing a limitation with PrimeNG TreeTable PT (PassThrough) support.
Currently, PT works only on the root element, but all internal DOM nodes ignore PT attributes, making it impossible to style TreeTable locally without using global CSS or ::ng-deep.
This contradicts PrimeNG’s PT design goal of component‑scoped customization.
Problem Summary
The following TreeTable internal elements do not receive any PT classes/attributes:
Frozen / Unfrozen containers
elements (scrollable/frozen views) Rows, cells, togglers Structural tags: , , ,Scrollable header / body
This severely limits customization, especially when migrating away from deprecated ::ng-deep.
What Works
Only the root PT key:
HTML
What Cannot Be Styled Using PT
These DOM nodes never receive PT classes:
HTML
Reproduction
PT Configuration
export const CertificateSiteTreeTablePT = { root: { class: "certificate-site-table-wrapper" }, table: { class: "my-table" }, // ❌ Not applied thead: { class: "my-thead" }, // ❌ Not applied tbody: { class: "my-tbody" }, // ❌ Not applied row: { class: "my-row" }, // ❌ Not applied cell: { class: "my-cell" }, // ❌ Not applied};
Component Usage
<p-treeTable [pt]="CertificateSiteTreeTablePT">
Inspecting DOM
Only root PT applied
No PT classes on internal elements
What We Tried
Only root works. Others are ignored silently.
TypeScripttable: ({ parent }) => ({ class: parent.instance.frozen ? "my-frozen" : "my-unfrozen"});
Callback executes, but no classes appear in DOM.
Not applied → TreeTable DOM is outside Angular encapsulation.
TreeTable does not expose variables for scroll containers, layout, toggler, frozen view behavior.
DT does not expose internal structure either.
Not working
Need suggestion on this.
Stackbliz: https://stackblitz.com/edit/stackblitz-starters-ftaeujz1?file=src%2Fapp%2Fcustom-treetable%2Fcustom-treetable.html
Beta Was this translation helpful? Give feedback.
All reactions