Viewport Row Model
Summary
- The Viewport Role Model is one of the 3 server-based Row Models provided by AG Grid
- The server will provide data for exactly those rows currently viewable by the User
- This can be useful when updating very large live datastreams
- This comes at a price - many important features in AG Grid (and AdapTable) are missing
- However (as with Server-Side Row Model) AdapTable provides many features to help with remote searching
AG Grid provides a Viewport Row Model option, used in very specific (and rare) use cases.
As described in the AG Grid documentation, the purpose of the Viewport Row Model is to:
show a 'window' of data in your client. Typically all the data will reside on the server and the server will know what data is displayed in the client. This is again useful for the server to push changes out to the client as it knows what data is currently displayed.
Caution
-
We don't recommend the Vieport Row Model: its benefits rarely outweigh the many accompanying complications
-
AG Grid also recommend using the more powerful Server-Side Row Model. They advise:
"Don't use Viewport Row Model unless you understand what advantages it offers and whether or not you need them. We find many of our users are using Viewport Row Model when they don't need to and end up with unnecessarily complicated applications as a result."
Limitations
Using the Viewport Row Model comes at a significant cost as many features in AG Grid are not available.
These include many commonly used Grid elements such as:
- Filtering
- Grouping
- Pivoting
- Lazy Loading
- Aggregations
- Transaction Updates (sync & async)
Hint
All of these - with the exception of filtering - are available in the Server-Side Row Model
Find Out More
- See the full list of features unavailable in the Viewport Row Model in AG Grid's Row Model Comparisons Table
Filtering
As noted above, when using the Viewport Row Model, AG Grid will not perform any filtering.
Instead it will hand off those tasks to the server to perform.
This means that it is the developer's responsibility to perform the actual filtering on the server.