Premium support for our pure JavaScript UI components


Post by david10sing »

How to reproduce

  1. Go to a demo with remote pagination and with selection modes enabled
  2. Navigate to the last page where there is only 1 row
  3. Select the 1 row
  4. Navigate to previous page and notice how the check all check box is checked.

Expected behaviour

  1. Navigating to a different page should check if all the rows have been selected

Post by mats »


Post by david10sing »

Hi Mats,

I've had a look at the fix. It looks like the state is no longer kept now with the Grid.

This is currently working except for the check all.
https://www.loom.com/share/09a39e8900b04e4882d52188e2eac6e8

Notice how the state of the selectedRecords is kept.

After updating to 4.1.5
https://www.loom.com/share/cf4e5ee3c2cb41ccb4ff166c5c75824c

The state of the selectedRecords is not kept after navigating to a different page.

Also navigating to a different page triggers selectionChange could we make it so it does not do that?

I think preserveSelectionOnDatasetChange is conflicting with this or it is not working.


Post by mats »

I've had a look at the fix. It looks like the state is no longer kept now with the Grid.

This is actually intentionally not kept, since we do not support keeping references to records that are not in the store. If you modified a record from the selectedRecords array that is not currently in the current page it would not trigger any data changes (save etc).

Also navigating to a different page triggers selectionChange could we make it so it does not do that?

By our design, this is also correct. If as in your case you show selected records count - it needs to update anytime the selection changes.


Post by david10sing »

Hi Mats,

Thank you for your response. I do update a separate store called selectedItemsStore. This gets updated in the onSelectionChange callback.

However, onSelectionChange gets called when there is a page change and fires a deselect action. This means that when there is a page change, my selectedItemsStore gets emptied because of the deselect action.

Would there be a more appropriate event listener for me to use to manage the selected items? Prompt response would be appreciated as we currently have 3 developers working on 3 different projects putting tasks on hold waiting for a solution on this.


Post by mats »

We'll try to add this feature to maintain selection in 4.1.6, thanks for feedback!

https://github.com/bryntum/support/issues/3079


Post Reply