primereact icon indicating copy to clipboard operation
primereact copied to clipboard

TreeTable: passing row property to the table pass through is not working

Open BAISTM opened this issue 1 year ago • 3 comments

Describe the bug

Row passthrough's root property is injected directly in the DOM instead of being parsed.

DOM:

Image

Code:

Image

Reproducer

https://stackblitz.com/edit/ymsdhzlr-ke9rnhph?file=src%2FApp.jsx

System Information

primereact: 10.9.1

Steps to reproduce the behavior

No response

Expected behavior

No response

BAISTM avatar Jan 23 '25 14:01 BAISTM

Defining the callback at the row level works correctly (maybe it's a TS issue?) but unfortunately the passed data does not contain elements allowing us to identify a specific row , IMHO, the row ID should be passed to the callback.

Image

BAISTM avatar Jan 23 '25 15:01 BAISTM

PR is welcome. The typescript should be easy to fix. As for the row Id not sure

melloware avatar Mar 12 '25 00:03 melloware

I've noticed bodyCell doesn't work either, and there isn't a cellClassName like in <DataTable />. Example:

<TreeTable
  // ...
  pt={{
    bodyCell: { className: 'p-0' }
  }}
/>

inad9300 avatar Apr 30 '25 16:04 inad9300