In the context of a Kendo Grid, skip is a parameter primarily used for implementing server-side paging. It tells the data source how many records to pass over before returning the results for the current page.
Understanding the Skip Parameter
Based on the provided reference, the skip parameter indicates the number of data items that should be skipped when a new page is formed. This parameter works hand-in-hand with the take
parameter.
skip
: The number of records to bypass from the beginning of the data set.take
: The number of records to retrieve after skipping the specified number.
When a user navigates through pages in a Kendo Grid configured for server-side operations, the grid sends a request to the server that includes skip
and take
parameters. The server uses these values to fetch only the data required for the specific page being viewed, rather than loading the entire dataset.
Skip and Paging Explained
Imagine you have a dataset of 100 records and your Kendo Grid displays 10 records per page (take = 10
).
Page | Skip Value | Take Value | Records Retrieved |
---|---|---|---|
1 | 0 | 10 | Records 1-10 |
2 | 10 | 10 | Records 11-20 |
3 | 20 | 10 | Records 21-30 |
... | ... | ... | ... |
10 | 90 | 10 | Records 91-100 |
When you click to view page 2, the grid calculates the skip
value as (Page Number - 1) * Take Value
. So for page 2 with take=10
, skip = (2-1) * 10 = 10
. This tells the server to skip the first 10 records and then take the next 10 (records 11-20).
Practical Implications
Using skip
and take
for server-side paging is crucial for performance when dealing with large datasets. Instead of transferring thousands or millions of records to the browser, the server only sends the small subset needed for the current page, significantly reducing load times and improving the user experience.
In essence, skip
is the mechanism that allows the grid (and your server-side code) to understand which "chunk" of data corresponds to the current page request.