Conditional Expander in a Column in a Data Table

UI Components for React
Post Reply
Posts: 11
Joined: 26 Aug 2020, 14:14

01 Jun 2021, 13:21

I'm using a Data Table with the expander prop. I want to make the column expander conditional. I know this can be done by

Code: Select all

<Column  expander={isNeeded ? true : false} />
But the problem is that I don't have access to the variable that I need. I need the condition to be based on the data that's in the row itself. I can make a body prop and get the data I need but then then I can't use it on the same column. Is there any way to access to actual rowdata so I can make the condition based on it?


Posts: 4
Joined: 04 Nov 2021, 12:20

19 Nov 2021, 10:42

Hi Kevin,

Did you discover how to do this?

As I'm stuck in the same place...

Thank you,

Posts: 4860
Joined: 29 Jun 2013, 12:38

21 Nov 2021, 00:41


Nice feedback! Could you please create a Github issue for it?

Best Regards,

Posts: 4
Joined: 04 Nov 2021, 12:20

30 Nov 2021, 10:55

Thank you Mert,

I've raised an issue and also created a sandbox so the issue can be easily seen. ... rc/App.vue

Keep well,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests