This is a migrated thread and some comments may be shown as answers.

Bug with scrollbar position

19 Answers 655 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 14 Apr 2015, 11:25 PM

Hello,

 I discovered a bug with the grid's vertical scrollbar when dealing with asynchronous read call.  Indeed, if you start moving scrollbar's slider with the mouse up and down, you'll end up firing a bunch of Transport.Read requests.  If those requests are treated asynchronously (like most ajax requests), the grid seems to have some problem displaying the right data.

 I did create this snippet to simulate the problem.  If you take a look at my print screen, you'll notice that the displayed indexes are from 42401 to 42600 out of the 250 000 records.  However, you'll also notice that the slider is almost at the bottom of the slider.  Based on the __count value provided to the grid, the slider position for those indexes should be somewhere near the top of the scrollbar (about 20%).  

This image alone is enough to confirm a problem with the grid scrollbar. However, the real problem is not the slider position but the displayed data itself. Indeed, by releasing the slider at this position I was expecting the indexes over 230 000 to be displayed but it's not the case.

 Is there a workaround to fix this?

 Best regards,

 Simon

19 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 16 Apr 2015, 11:11 AM
Hello Simon,

I am not able to reproduce the described problem. Here is a video, let me know if I am missing something.

http://screencast.com/t/wLK3pnCnU9mS

Generally, we specially made improvements in the Grid code to avoid this issue in Kendo UI version 2014.2.716. Before that, the inconsistency could be exhibited on a random basis, depending on a combination of the following factors:

- scrolling speed
- page size
- Grid height
- server response time

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Simon
Top achievements
Rank 1
answered on 20 Apr 2015, 06:26 PM

Hello Dimo,

Here's a screencast of the problem: http://www.screencast.com/t/UxI8pBXl

To problem will occur if you go up and down before releasing the slider.

Regards,

Simon

 

0
Dimo
Telerik team
answered on 22 Apr 2015, 06:34 AM
Hi Simon,

It appears that the specific databinding technique used in the mockup example manages to circumvent the algorithms, which take care of preventing the issue with the incorrect rows being shown. Please usе an approach similar to one of the following:

http://demos.telerik.com/kendo-ui/grid/virtualization-remote-data

http://demos.telerik.com/kendo-ui/grid/virtualization-local-data

One more thing that you can do is force the Grid dataSource to make requests only after the user stops scrolling. This is achieved by executing the following line before initializing the Grid:

kendo.ui.VirtualScrollable.fn.options.prefetch = false;

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Simon
Top achievements
Rank 1
answered on 22 Apr 2015, 03:28 PM

Hello Dimo,

Before implementing our logic, we followed kendo's documentation for the Transport.Read and the WebSocket example.  The mockup I provided in the snippet is only a simplified version of what's really going on our side.  I really think Kendo should consider fixing this because this feature is really useful and it gives us a lot of flexibility to handle our data.

The good news here is that your workaround is solving the issue... disabling prefetch is something I've been asking for awhile (see this post).  However, unlike the Transport.Read, disabling prefetch isn't officially supported by Kendo​ (see Kiril Nikolov answer to my post).

I think Kendo should fix both of the problem mentioned above (custom Transport.Read + support prefetch disabling).

Best regards,

Simon

 

0
Simon
Top achievements
Rank 1
answered on 24 Apr 2015, 02:25 PM

Hello Dimo,

After we changed the preftech value to false, we started experiencing performance problems elsewhere in the grid.  Indeed, if the grid's verticalScrollbar scrollTop function, get called, it will always trigger the grid's dataBound callback.  This behaviour is slowing navigation even if you are scrolling with a page that is already fully loaded.

Right now, the choice that we have is a grid that may not display the right data based on the slider position or a slower grid navigation.

Regards,

Simon

0
Dimo
Telerik team
answered on 28 Apr 2015, 10:32 AM
Hi Simon,

Disabling prefetches changes the Grid behavior in the following ways:

- disables background data requests during "slow" scrolling, so sooner or later 
- new data is requested only after the user stops scrolling

Probably you are talking about the effect that disabled background requests have on the user experience, as data is not immediately available after scrolling, unless the user has already been at the given scroll position previously and the data has been cached. This is expected.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Simon
Top achievements
Rank 1
answered on 28 Apr 2015, 02:14 PM

Hello Dimo,

No, actually, the real problem here is when you try to scroll within the same page of data.

EX:

1-The current scroll position loads item 200 to 299

2- Usually, the grid's height will allow you to display only a part of those rows so let say that rows 230 to 239 are visibile.

If you want to scroll down to row 240 from there (using the row's top position), you will have to call the verticalScrollbar scrollTop function and this is where the problems starts.

If the prefetch is enable (default value): the grid will simply scroll to the row 240 without triggering anything else.  That's the expected behavior (but the prefetch is causing the slider issue I pointed out in this post)

If the prefetch is disable: the grid will scroll to the row 240 AND trigger the grid dataBound callback.  It's not necessary to trigger the callback at this point since the grid has already loaded all the data to be displayed.  Triggering the dataBound callback have a real impact on the grid performance, especially when you want you need to navigate within the grid.

0
Dimo
Telerik team
answered on 29 Apr 2015, 03:32 PM
Hello Simon,

Yes, that is correct - in this mode the Grid rebinds itself every time scrolling stops, eventhough it does not make a new remote request. The dataBound event is not tied to remote requests, but to table re-rendering, which occurs in this case.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Simon
Top achievements
Rank 1
answered on 29 Apr 2015, 03:48 PM

Hello Dimo,

Do you plan fixing any of these, or adding a flag in the dataBound event that would indicate the the rendering isn't necessary?

Best regards,

Simon

0
Dimo
Telerik team
answered on 04 May 2015, 05:38 AM
Hi Simon,

The dataBound logic and table row re-rendering is implemented like this on purpose and we do not plan changing it. It is also worth noting that this behavior is related to a private API setting (enabled/disable prefetches).

With regard to scroll positioning during virtual scrolling, we are currently working on virtual scrolling keyboard navigation, so I am not sure we will have resources to improve the scrolling behavior in the near future.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Simon
Top achievements
Rank 1
answered on 04 May 2015, 11:38 AM

Hello Dimo,

Disabling the prefetch may fall into the "feature request" section, but the scrolling position is really a bug that diverse to be fixed.  I don't know if Kendo has some kind of bug tracking system, but can you confirm if that bug was listed somewhere in order to be fixed?

Best regards,

Simon

0
Dimo
Telerik team
answered on 06 May 2015, 09:21 AM
Hi Simon,

I agree that the virtual scrolling behavior would certainly benefit from some improvements, but this is the best implementation we have come up with so far.

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Simon
Top achievements
Rank 1
answered on 06 May 2015, 10:59 AM

Hello Dimo, 

What I mentioned here is a bug, not a feature request.

The main question here is the following: Will Telerik list this as a bug, giving us some hope for a short term fix or will they wait until a uservoice's request reach enough vote before considering any fix.  If the solution to the bug is to add a feature to the virtual scrolling, they should consider doing it in priority because you know that the seconds options may take some months, even years before we get an implementation.

I can't tell my users to wait forever before getting a fix to this bug...

Best regards,

Simon

0
Iliana Dyankova
Telerik team
answered on 08 May 2015, 12:49 PM
Hi Simon,

We do not consider this as a bug, it is rather limitation of the current implementation. As Dimo said, some improvements might be done in the future, however this it the best implementation we have come up for the moment. Please excuse us for any inconvenience this may cause.

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Simon
Top achievements
Rank 1
answered on 12 May 2015, 06:51 PM

Hello Iliana, 

I beg to differ but my users claims that displaying data that doesn't match with a slider is a bug...  If tell them it's a limitation and not a bug, I better get a good explanation because they won't agree so easily.

Is it such a big deal for Telerik to fill a bug report?

Simon

0
Dimo
Telerik team
answered on 14 May 2015, 03:11 PM
Hello Simon,

Our Grid developers made a change in the Kendo UI DataSource implementation, which should improve the algorithms related to request cancellation and the virtual scrolling behavior. When testing with the new code, we were no longer able to observe the discussed scrollbar-position-vs-data-items discrepancy.

Changes will take effect in the next internal build.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Simon
Top achievements
Rank 1
answered on 26 May 2015, 08:37 PM

Hello Dimo,

Thank you!  This is appreciated and my users will get an improved user experience.

Simon

0
Stephen
Top achievements
Rank 1
answered on 16 May 2016, 03:10 PM

Hi Dimo,

 

Can you confirm that this change made it into 2015.3.1111 please?  We're having similar issues with the virtualised grid, where data is not being shown, as the virtual scroll bar is positioned at the bottom of the scroller container, yet not all the data is being rendered.

 

Thanks

 

Steve

 

0
Dimo
Telerik team
answered on 17 May 2016, 10:35 AM
Hello Steve,

Yes, I confirm. Please ensure that the Grid configuration is in accordance with the documentation guidelines and if needed, provide a runnable test page for inspection.

http://docs.telerik.com/kendo-ui/controls/data-management/grid/appearance#virtual-scrolling

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Simon
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Simon
Top achievements
Rank 1
Iliana Dyankova
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or