primevue icon indicating copy to clipboard operation
primevue copied to clipboard

DataTable: Columns Re-Render More Than Expected

Open incutonez opened this issue 2 years ago • 1 comments

Describe the bug

I have a grid with 1 column (fiddle). For the header, I call a method to get the display value. This method gets called 5 times. The DataTable only has 1 column, so does this mean that the columns render 5 times? If so, that seems like there's something being fired by the internal code to re-render 4 times. I don't know if this is a bug, or if I'm just being overly worried about the perf of this. Obviously the more columns, the more this number grows.

Reproducer

https://stackblitz.com/c/edit/edanqp?file=src%2FApp.vue

PrimeVue version

3.47.x

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

FireFox

Steps to reproduce the behavior

  1. Go to https://stackblitz.com/c/edit/edanqp?file=src%2FApp.vue
  2. Open the debugger and notice the console.log has fired 5 times

Expected behavior

There should only be 1 console.log, as I have not made any changes to the columns, so I don't know what would've triggered it to rerun the header function.

incutonez avatar Feb 04 '24 17:02 incutonez

Thanks a lot for your report! I set a milestone. I think we can make some changes related to it. I'll check after the milestone is released.

mertsincan avatar Feb 09 '24 10:02 mertsincan