Login Register

Can someone explain grid virtual scrolling?

I just read the Dojo 1.0 announcement and it says the grid comes

With support for virtual scrolling to accommodate huge data sets efficiently

Does this mean that if I have a dojo.data store object that is connected to a table with over 100,000 rows, the dojox grid will effeciently page through the data? If so, how is this enabled in the grid? I can't find any documentation about this feature.

Defining virtual scrolling

First, let's see what others have to say about it...

The source summarizes it as:

virtual scrollbox, abstract class
Rows are managed in contiguous sets called /pages/
There are a fixed # of rows per page
The minimum rendered unit is a page

Similar feature in Rico LiveGrid is explained as:

The scroller becomes the replacement for the standard Previous/Next page controller bar. When dragging the scroll bar you are actually issuing ajax commands to pull the data into the table in real time!

It's been discussed:

Rendering large amounts of data as dhtml is very costly especially as the user can only see a small subset of the data at any given moment. Think of the “ajax” screen as a virtual window on the dataset that can be sorted or filtered dynamically then displayed in the virtual window with eyeblink speed without altering the underlying data.

It also compares to infinite scrolling and to virtual workspace:

Provide a browser-side view into a server-side workspace, allowing users to navigate the entire workspace as if it were held locally. The illusion is that the entire workspace is already in the browser, while the reality is that the server actually provides content on demand.

To summarize, for performance reasons a virtual scrollbar makes it look like that you'd be working with a long table while in fact only a part of the table exists. This smaller table is then updated with data to create the illusion that you would have had scrolled down on the long table.