Page 1 of 1

[ANGULAR] selected row on grid blinks on page changes

Posted: Fri Aug 19, 2022 11:35 am
by panu

We have a problem with Bryntum Grid when selecting row with selectionMode: row and changing a page. After page changes grid selects previously selected rowindex on next pages and causes unwanted action in our implementation because selectionChange event launches.

This same problem can be reproduced in your https://www.bryntum.com/examples/grid/paged/ demo. Adding

selectionMode { row: true, checkbox: true }

for testing purposes. When using row-click to select rows this problem happens. You can see the row flashing once during page change. But if i'm using checkbox to select row or I click outside of grid before changing a page this problem doesn't happen.

Is this intended or bug?


Re: [ANGULAR] selected row on grid blinks on page changes

Posted: Fri Aug 19, 2022 2:38 pm
by Animal

Yes, it is only if using checkboxes. I surmise that when the checkbox widget is recycled, it reverts to being unchecked, but it's still connected to the record, so that unchecking event gets to the selection handling which deselects the record.

Here's a ticket: https://github.com/bryntum/support/issues/5090


Re: [ANGULAR] selected row on grid blinks on page changes

Posted: Fri Aug 19, 2022 2:48 pm
by Animal

OK, it just seems to be configuration that you need:

preserveSelectionOnPageChange : true


Re: [ANGULAR] selected row on grid blinks on page changes

Posted: Fri Aug 19, 2022 2:50 pm
by Animal

Re: [ANGULAR] selected row on grid blinks on page changes

Posted: Mon Aug 22, 2022 8:42 am
by panu

Preserving selection on page change is not what we want. Also this does not solve the problem where the "unselected" row keeps flashing on page change. This seems to work correctly when selecting the row from checkbox, but not when selecting by clicking the row. In our case we wouldn't like to have checkbox at all on our solution since we already have checkbox on the first column on other purposes.

Based on our tests

preserveSelectionOnPageChange : true

did not even preserve the selection when the row was selected by clicking the row.


Re: [ANGULAR] selected row on grid blinks on page changes

Posted: Mon Aug 22, 2022 8:06 pm
by marcio

Hi Panu,

I added that option as well in our demo and reproduced the behavior you described. Created a ticket to fix it - https://github.com/bryntum/support/issues/5097

Thanks for the report.


Re: [ANGULAR] selected row on grid blinks on page changes

Posted: Tue Aug 23, 2022 8:43 am
by panu

Thanks! Just want to clarify that on that same demo if you click to page 3 and further the originally selected row starts flashing. Our goal is not to preserve the selection, but also prevent the flashing when switching pages (and ecpecially when operating without checkbox).


Re: [ANGULAR] selected row on grid blinks on page changes

Posted: Tue Aug 23, 2022 11:17 am
by alex.l

Thank you for your message! I've updated the ticket with this information. We'll take care of it.