New to Kendo UI for Angular? Start a free 30-day trial

Grid Legacy Virtualization Requirements

Environment

Product Progress® Kendo UI for Angular Grid

Description

This article explains the requirements for enabling legacy virtualization in the Kendo UI for Angular Grid for versions below 19. Starting with version 19, most of these requirements are optional or handled automatically by the Grid, making virtualization more streamlined.

Requirements

The following configuration properties are required for legacy virtualization in versions earlier than 19. In version 19 and above, most of these are optional and handled automatically by the Grid:

PropertyRequirement (v < 19)Requirement (v ≥ 19)Description
height RequiredRequiredSet a fixed height for the Grid, either through the input or CSS.
scrollable RequiredRequiredSet to "virtual".
data RequiredRequiredProvide data as GridDataResult with a total field.
rowHeight RequiredOptionalSet the row height for calculations (v < 19: for calculations only, v ≥ 19: sets actual row height in the DOM).
skip RequiredOptionalSet the number of rows to skip when scrolling.
pageSize RequiredOptionalSet the number of rows to display in the Grid. Should be at least three times the visible rows in the Grid.
detailRowHeight OptionalOptionalSet if using detail rows.

For grouping the kendoGridGroupBindingdirective is required to be set for the Grid data. The directive supports only the processing of in-memory data and you have to provide the full set of data that will be processed.

html
<kendo-grid [kendoGridGroupBinding]="data"></kendo-grid>

Example

Example setup for legacy virtualization:

css
/* Sets the row height for the Grid */
.k-grid .k-grid-content td {
 white-space: nowrap;
 line-height: 20px;
 padding: 8px 12px;
}
html
<kendo-grid
 [data]="gridData"
 [height]="400"
 scrollable="virtual"
 [rowHeight]="36"
 [skip]="skip"
 [pageSize]="pageSize"
 (pageChange)="onPageChange($event)">
 <!-- ...columns... -->
</kendo-grid>
typescript
public gridData: GridDataResult = { data: [], total: 0 };
public skip = 0;
public pageSize = 100;
public onPageChange(event: PageChangeEvent): void {
 this.skip = event.skip;
 // Load data for the current page
}

The following example demonstrates the legacy setup for both data binding and grouping virtualization. Use the switch button to toggle between both bindings.

Change Theme
Theme
Loading ...
Not finding the help you need?
Contact Support

AltStyle によって変換されたページ (->オリジナル) /