Welcome to the React feedback portal. We’re happy you’re here! If you have feedback on how to improve the React, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

With a grid with paging and with checkbox selection and rowSelected/rowDeselected events then I've found that if I select all rows using the header in the checkbox column and then change page I get a rowDeselected event triggered for the rows on the page that's just been changed to followed by a select event for all the rows. This was a surprise to me - I don't know if it's expected behaviour and I've missed it in the documentation, but it seems most likely an unintended consequence of the persistSelection code and so I've logged it as a bug. From a quick look at the code it looks like the persistSelection code goes to clear the rows on the new page before selecting them and that's probably leading to the rowDeselected event (haven't looked into why there's then that rowSelected event).

The other thing to note is that if the page you change to is the last page and it's a partial page (i.e. the number of rows is less than the pageSize) then in the event data for the rowDeselected event you get an "undefined" entry for each row that isn't shown (which is also odd and a surprise).

Ideally for me persistSelection wouldn't trigger those events just in the course of changing paging - however it's deliberate or necessary that it triggers the events then it would be useful to have that documented and perhaps also ensure that the rowDeselected event doesn't include entries related to non-existent rows (i.e. the "undefined" entries in event.data).

To help illustrate what I mean I took a checkbox example from your documentation in StackBlitz and modified the settings to change the page size, enable persistSelection and also log the data on selected/deselected events:

https://stackblitz.com/edit/react-ttcu6f?file=App.js

So a quick test to show both the things I'm talking about would be to click on the checkbox column header to select all - you will see in the console a selected event logged with data for all 15 entries in the data source.

Next click on the pager button to jump to the last page - you will see in the console a deselected event logged with 4 entries in data, 3 of which will be for the visible rows plus one undefined (as the pageSize is 4) followed by a selected event for all 15 entries in the data source, e.g.:

gridpersistselect.png