primereact icon indicating copy to clipboard operation
primereact copied to clipboard

DataTable: seems to re-render all the rows on select all, even with the pagination.

Open tmmschmit opened this issue 3 years ago • 7 comments

Describe the bug

Hi, so I'm trying to implement a bulk edit on a DataTable with a large amount of entries. But the more entries the table contains, the more slower it is to display the select rows. I did some tests with a lazy loading and it's much quicker without taking care of the entries number. But this way I lose the sorting and ordering feature of DataTable.

So is there a way to only re-render the visible rows of a DataTable with pagination?

Thanks!

Reproducer

https://codesandbox.io/s/primereact-test-forked-vqhyjv?file=/src/index.js

PrimeReact version

8.1.1

React version

18.x

Language

ALL

Build / Runtime

Create React App (CRA)

Browser(s)

FireFox 101, Chromium 102

Steps to reproduce the behavior

  1. Open the link
  2. Click on the checkbox in the header
  3. change the ENTRY_MULTIPLIER value to see the render speed change.

Expected behavior

Render only the visible rows of the DataTable when the checkbox in the header is clicked.

tmmschmit avatar Jun 09 '22 14:06 tmmschmit

I got the same performance issue. It seems DataTable re-render all rows and cells every time non-value props (size, showGridlines, resizableColumns, scrollable, etc) were updated.

devken-net avatar Jul 29 '22 18:07 devken-net

Same issue here. Tried it already with the v10.0.0. Here is the reproducer:

https://codesandbox.io/s/primereact-test-forked-hw8rwr?file=/src/index.js the issue has already been described here in the discussion: https://github.com/orgs/primefaces/discussions/114

VeladzicKAG avatar Oct 06 '23 06:10 VeladzicKAG

I got the same performance issue. It seems DataTable re-render all rows and cells every time non-value props (size, showGridlines, resizableColumns, scrollable, etc) were updated.

You are right. I have 50 rows in my datatable, even a single selection causes the datatable to re-render everything, as it is also the case when changing a field of a single row (when value mutates). A bit disappointed on this one. :(

image

torshid avatar Oct 27 '23 13:10 torshid

Any news on this? I see a lot of bugs being fixed but not this one. :(

mdimitrov94 avatar Apr 08 '24 10:04 mdimitrov94

@mdimitrov94 if you need immediate support I suggest looking into PrimeReact PRO support.

melloware avatar Apr 08 '24 11:04 melloware