Documentation

Report Edit

Infinite Grid Scrolling

Infinite scrolling is a technique of dynamically loading additional data based on the scroll position. Grids support infinite by setting the infinite flag and implementing the onFetchRecords callback which is responsible for fetching data based on current the visible page and active sorting and filtering parameters. Fetch result should be an object containing the records property containing an array of records; The lastPage flag should be set if there is no remaining data. Alternatively, totalRecordCount can be used to indicate total number of records. If necessary, the fetch result should include state to pass data such as pagination tokens or cursor positions between fetch results.

#NameContinentBrowserVisits
1Cameron SauerAustraliaChrome58
2Ramon LockmanAsiaOpera71
3Rhea RippinAsiaEdge9
4Darien RauAfricaSafari70
5Hank TorphyAntarcticaSafari30
6Karianne TowneSouth AmericaOpera22
7Bryana FraneckiSouth AmericaInternet Explorer37
8Ward SchmittAsiaOpera51
9Coleman SchillerAfricaEdge74
10Delta JohnsonAsiaFirefox29
11Johnnie KertzmannAustraliaFirefox16
12Alejandrin GoodwinAustraliaInternet Explorer25
13Pedro BruenAfricaChrome33
14Jonathan HandAsiaOpera85
15Jaquan GrantAsiaEdge28
16Rosalee SchneiderAustraliaInternet Explorer45
17Daphney HudsonNorth AmericaFirefox97
18Maritza GoyetteNorth AmericaInternet Explorer98
19Deborah EmmerichEuropeChrome3
20Jamison TurcotteNorth AmericaEdge26
21Yesenia FadelSouth AmericaInternet Explorer61
22Cristal SengerAfricaFirefox43
23Sonny OsinskiNorth AmericaInternet Explorer50
24Herman FadelAustraliaEdge18
25Bertrand TorpAustraliaOpera8
26Jaqueline RunolfssonNorth AmericaFirefox28
27Sydney KovacekNorth AmericaOpera87
28Bennett FerryAntarcticaOpera15
29Ross AbshireAntarcticaInternet Explorer29
30Parker AbernathyNorth AmericaEdge24
31Alexandrea DareAustraliaOpera83
32Johnny LindAustraliaFirefox31
33Wilmer GibsonNorth AmericaEdge7
34Antonietta ManteSouth AmericaFirefox42
35Unique GerlachEuropeFirefox6
36Marty MoenAntarcticaFirefox78
37Michale DavisAfricaEdge21
38Brandi HauckAfricaEdge94
39Armando ThielAfricaFirefox41
40Breanne JastSouth AmericaInternet Explorer61
41Florencio CorwinAsiaChrome92
42Otto DonnellyAfricaOpera8
43Ford MuellerEuropeFirefox78
44Ayden SatterfieldAntarcticaOpera27
45Major RosenbaumAustraliaOpera59
46Curtis BauchAsiaOpera42
47Ora AbshireAsiaInternet Explorer63
48Heath UllrichAfricaInternet Explorer41
49Willa YundtAsiaInternet Explorer83
50Ronaldo KubAsiaInternet Explorer54
51Alexie GloverSouth AmericaChrome91
52Talon CummingsAustraliaInternet Explorer31
53Vita MurazikAfricaOpera77
54Bryana AufderharAustraliaFirefox87
55Laurine HeathcoteAntarcticaFirefox45
56Lora StreichAustraliaFirefox80
57Dawson LubowitzAntarcticaInternet Explorer30
58Natalie CormierEuropeSafari56
59Providenci FlatleyAsiaOpera9
60Estrella BechtelarAfricaEdge5
#NameContinentBrowserVisits
InfiniteScroll Grid
<Grid
    infinite
    style="height: 800px"
    lockColumnWidths
    cached
    keyField="question_id"
    columns={[
        {header: "#", field: "id", sortable: true},
        {header: "Name", field: "fullName", sortable: true},
        {header: "Continent", field: "continent", sortable: true},
        {header: "Browser", field: "browser", sortable: true},
        {header: "Visits", field: "visits", sortable: true, align: "right"}
    ]}
    selection={{type: KeySelection, bind: "$page.selection", keyField: "id"}}
    onFetchRecords={({page, pageSize}) => new Promise(resolve => {
        setTimeout(() => {
            let records = [];
            for (let i = 0; i < pageSize; i++)
                records.push({
                    id: (page - 1) * pageSize + i + 1,
                    fullName: casual.full_name,
                    continent: casual.continent,
                    browser: casual.browser,
                    title: casual.full_name,
                    visits: casual.integer(1, 100)
                });
            resolve({
                records,
                totalRecordCount: 100000
            });
        }, 100);
    })}
/>
Copied!Cx Fiddle