Conditional Expander in a Column in a Data Table

UI Components for React
Post Reply
kevinquinn1918
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?

Thanks,
Kevin

MarkEdmunds
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,
Mark

mert.sincan
Posts: 4773
Joined: 29 Jun 2013, 12:38

21 Nov 2021, 00:41

Hi,

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

Best Regards,

MarkEdmunds
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.

https://github.com/primefaces/primevue/issues/1834
https://codesandbox.io/s/vue-primevue-f ... rc/App.vue

Keep well,
Mark

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests