Kendo-angular: Grid: Multiple Selection behaves strange in combination with Virtual Scrolling

Created on 7 Sep 2017  路  11Comments  路  Source: telerik/kendo-angular

I'm submitting a...

  • Bug report

Current behavior I

When I select the first item and then scroll down to the last item hold SHIFT and click on the last item, then only those items currently visible and the first item will be selected.

Expected behavior I

I would expect all items to be selected.

Current behavior II

When I select the first item and then scroll down to the last item and click on the last item, then the last item and the first item will be selected. (The invisible first row was not deselected.)

Expected behavior II

I would expect only the last item to be selected. Not the first item!

Minimal reproduction of the problem with instructions

http://plnkr.co/edit/dcVwa6kX47Kuw0GZsqQP?p=preview

To reproduce I:

  • select first row
  • scroll to end
  • hold SHIFT and select last row
  • scroll up a little to see the problem

To reproduce II:

  • reload
  • select first row
  • scroll to end
  • click on last row
  • scroll to first row to see the problem

What is the motivation or use case for changing the behavior?

The selection of the rows should work like selection of rows always work:

  • Keep previously select with Ctrl
  • Clear previously selected without Ctrl
  • select from previously selected to currently selected with Shift

Environment

Package versions:

  • reproducible in Plunker

Browser:

  • Chrome (desktop) version 60.0.3112.113 (Offizieller Build) (64-Bit)
  • Firefox version 55.0.3 (32-Bit)

System:

  • TypeScript version: 2.4.2
  • Node version: v8.4.0 5.4.1
  • Platform: Windows

A guess:

I think the problem is that the selection event handles only the rows of the currently loaded virtual page. It would be necessary to load all the rows.

Bug grid

Most helpful comment

Please reopen this bug.
It does not make sense when user scrolls and click on a row without holding the CTRL button, the new row is added to the previous selection.
This shouldn't be the expected behavior.
Users should always expect the same behavior regardless of whether virtual scroll is enabled.
This is a bug.
We can't expect that the end users accept this bug as 'by design' by knowing that virtual scrolling is enabled. Virtual scrolling is implementation details that user should not be aware of.
That the kendoGridSelectBy cannot select range across pages does not means that it cannot reset the selection when user click without holding the CTRL button.

All 11 comments

Hi @paoluptecoi,

The described behavior is expected, as indeed the selection operates only over the currently visible items. We are currently working on a "select all" feature and improvements for similar scenarios.

The select all feature has been introduced in v1.5.0.

This issue was not resolved by the select all feature. Please note that mentioning the first and the last item was only to provide a simple expamle. Please use the second and the second to last item in my description and you will see that the problem is not resolved with a select all feature.

Yes, as mentioned the selection operates only over the currently rendered items, so it is not aware of the items in-between the second and the second to last (which are not on the current page).

Then please reopen the issue. This is a bug.

Hi @paoluptecoi,

The described behavior is by design - the selection operates only over the currently rendered items - in the current case the items from the last page (after the Grid was scrolled). We will update the documentation regarding the selection, in order to clarify this better.

I understand that there is a problem with the design. But it is fixable. You can call the rowSelected function for the not redered rows and use that information for the selectionChange event.

Please try to understand the user's perspective. A user doesn't care about the underlying implementation. He wants the selection to work like it always does. Even like it does with this grid when virtual scrolling is not used.

What you are suggesting is that multiple selection can not be used with virtual scrolling.

To provide more context, in IE you are currently stuck with virtual scrolling, because of how bad performance with kendo grid is otherwise.
If it's by design then it's a very bad design.

@noariki we're investigating the performance issues in IE, but they're not directly related.

To summarise the problem so far - the kendoGridSelectBy directive cannot select ranges across pages, as it does not have access to the full list of data items.

In theory, it could be made to work for local data by operating on the processed (sorted, filtered and grouped), but non-paged data collection of the grid. There are no plans to implement such workaround at the moment, as it won't function at all with remote data.

An alternative would be to persist the selection by row position. This would work for the scenario at hand, but will break whenever the data set has changed - including sorting, filtering and grouping changes. You can try this prototype to get an idea for the limitations of this approach.

@tsvetomir Hi, thanks for the reply. I know that these issues are not connected, I was just pointing out that it's not some obscure scenario, people need this to work.
As for the prototype, at least in my application, I don't care if the selection is gone when sorting, filtering or grouping occurs. In fact, I want selection to be cleared in these cases. So I will try to use it as a work-around.

Please reopen this bug.
It does not make sense when user scrolls and click on a row without holding the CTRL button, the new row is added to the previous selection.
This shouldn't be the expected behavior.
Users should always expect the same behavior regardless of whether virtual scroll is enabled.
This is a bug.
We can't expect that the end users accept this bug as 'by design' by knowing that virtual scrolling is enabled. Virtual scrolling is implementation details that user should not be aware of.
That the kendoGridSelectBy cannot select range across pages does not means that it cannot reset the selection when user click without holding the CTRL button.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ilianiv picture ilianiv  路  3Comments

ilianiv picture ilianiv  路  3Comments

tsvetomir picture tsvetomir  路  3Comments

svetq picture svetq  路  3Comments

tsvetomir picture tsvetomir  路  3Comments