First name | Last name | Email |
---|---|---|
Dustin | Sawayn | Dustin.Sawayn@yahoo.com |
Earnest | Heller | Earnest6@yahoo.com |
Sheila | Kessler | Sheila.Kessler@hotmail.com |
Brayan | Macejkovic | Brayan3@hotmail.com |
Assunta | Ankunding | Assunta79@gmail.com |
Javonte | Schumm | Javonte14@gmail.com |
Jennifer | Von | Jennifer_Von87@hotmail.com |
Mozell | Becker | Mozell.Becker@yahoo.com |
Horace | Bayer | Horace.Bayer24@yahoo.com |
Chauncey | Hoeger | Chauncey.Hoeger7@gmail.com |
Remington | Hansen | Remington.Hansen9@yahoo.com |
Sammy | Mayer | Sammy.Mayer19@yahoo.com |
Marilou | Morar | Marilou.Morar@gmail.com |
Armando | Zieme | Armando_Zieme@gmail.com |
Dakota | Little | Dakota.Little@gmail.com |
Tyson | Howell | Tyson_Howell60@hotmail.com |
Bartholome | Gibson | Bartholome.Gibson@hotmail.com |
Leta | Corwin | Leta_Corwin@yahoo.com |
Geovany | Koelpin | Geovany_Koelpin97@hotmail.com |
Celine | Feest | Celine_Feest@hotmail.com |
Alanna | Bashirian | Alanna56@yahoo.com |
Eldred | Grant | Eldred.Grant@yahoo.com |
Freddy | Gottlieb | Freddy_Gottlieb@gmail.com |
Immanuel | Wolff | Immanuel.Wolff18@gmail.com |
Devante | Jakubowski | Devante98@yahoo.com |
Ilene | Green | Ilene.Green36@gmail.com |
Estevan | Ryan | Estevan_Ryan35@gmail.com |
Jeffry | Roberts | Jeffry.Roberts61@yahoo.com |
Etha | Kerluke | Etha52@gmail.com |
Hans | Baumbach | Hans79@yahoo.com |
Felipe | Kuhlman | Felipe_Kuhlman@yahoo.com |
Alfred | Jacobs | Alfred.Jacobs2@gmail.com |
Viva | Schmitt | Viva_Schmitt58@yahoo.com |
Emiliano | Kessler | Emiliano25@gmail.com |
Reymundo | Parisian | Reymundo.Parisian81@yahoo.com |
Carlee | Wehner | Carlee_Wehner@gmail.com |
Victor | Kiehn | Victor.Kiehn89@yahoo.com |
Trenton | Cronin | Trenton12@yahoo.com |
Jackeline | Mueller | Jackeline.Mueller@yahoo.com |
Mason | Reynolds | Mason_Reynolds@hotmail.com |
Myles | Schamberger | Myles.Schamberger@yahoo.com |
John | Murazik | John_Murazik@gmail.com |
Gerald | Terry | Gerald56@yahoo.com |
Hazel | Trantow | Hazel98@yahoo.com |
Litzy | Harris | Litzy_Harris38@gmail.com |
Leonie | Strosin | Leonie_Strosin@hotmail.com |
Ila | Runolfsdottir | Ila45@gmail.com |
Destiny | Jacobson | Destiny40@yahoo.com |
Christop | Tillman | Christop.Tillman@yahoo.com |
Curtis | Parker | Curtis_Parker@gmail.com |
Otto | Boehm | Otto.Boehm37@gmail.com |
Geoffrey | Pacocha | Geoffrey69@yahoo.com |
Reinhold | Rosenbaum | Reinhold.Rosenbaum28@hotmail.com |
Adan | O'Conner | Adan_OConner51@gmail.com |
Kelley | Keebler | Kelley.Keebler18@gmail.com |
Genoveva | Nikolaus | Genoveva.Nikolaus@hotmail.com |
Ana | Braun | Ana94@yahoo.com |
Mark | Pfannerstill | Mark_Pfannerstill74@hotmail.com |
Esperanza | Thompson | Esperanza36@yahoo.com |
Maribel | Kuvalis | Maribel_Kuvalis@yahoo.com |
Dorothy | Anderson | Dorothy.Anderson@hotmail.com |
Jayne | Stiedemann | Jayne_Stiedemann75@gmail.com |
Thalia | Crona | Thalia_Crona@yahoo.com |
Maude | VonRueden | Maude.VonRueden@hotmail.com |
Ellie | Franey | Ellie.Franey@yahoo.com |
Karley | Hauck | Karley_Hauck@yahoo.com |
Amiya | Lowe | Amiya.Lowe83@hotmail.com |
Nicola | Adams | Nicola48@yahoo.com |
Darrin | Moore | Darrin.Moore@gmail.com |
Braden | Heathcote | Braden84@yahoo.com |
Glennie | Bailey | Glennie_Bailey@gmail.com |
Agustina | Ruecker | Agustina24@yahoo.com |
Sim | Thiel | Sim_Thiel@gmail.com |
Valentin | Franey | Valentin33@gmail.com |
Mable | Kautzer | Mable.Kautzer@yahoo.com |
Torrance | Halvorson | Torrance.Halvorson@gmail.com |
Erica | Bogan | Erica.Bogan31@yahoo.com |
Addison | Sauer | Addison12@gmail.com |
Curtis | Rohan | Curtis_Rohan@gmail.com |
Caterina | Hodkiewicz | Caterina.Hodkiewicz14@yahoo.com |
Jarrett | Glover | Jarrett.Glover@yahoo.com |
Jamar | Lemke | Jamar1@hotmail.com |
Winona | O'Keefe | Winona86@yahoo.com |
Candelario | Kris | Candelario75@hotmail.com |
Maria | Casper | Maria41@gmail.com |
Shaylee | Larkin | Shaylee.Larkin@hotmail.com |
Genevieve | Cartwright | Genevieve.Cartwright@gmail.com |
Curtis | McLaughlin | Curtis.McLaughlin56@yahoo.com |
Ulises | Fay | Ulises52@yahoo.com |
Ivah | Weissnat | Ivah.Weissnat37@hotmail.com |
Darrin | Cartwright | Darrin86@yahoo.com |
Wiley | McClure | Wiley11@hotmail.com |
Lou | Cummings | Lou_Cummings62@gmail.com |
Johnathon | Leuschke | Johnathon29@hotmail.com |
Carleton | Witting | Carleton91@yahoo.com |
Brycen | Bergnaum | Brycen.Bergnaum52@hotmail.com |
Lyric | Lindgren | Lyric_Lindgren@gmail.com |
Corrine | Kassulke | Corrine89@gmail.com |
Johanna | Dietrich | Johanna8@hotmail.com |
Georgianna | Bruen | Georgianna.Bruen@gmail.com |
DataTable
triggers onScrollToTop
, onScrollToBottom
, onScrollToRight
and onScrollToLeft
callbacks when user scrolls to the top, bottom, left or right edge of the table. You can use the onScrollToBottom
event to implement infinite scrolling, like so:import { Button, Group, Text } from '@mantine/core';import { DataTable } from 'mantine-datatable';import { useEffect, useRef, useState } from 'react';import employees from '~/data/employees.json';export default function InfiniteScrollingExample() {const batchSize = 100;const [loading, setLoading] = useState(false);const [records, setRecords] = useState(employees.slice(0, batchSize));const scrollViewportRef = useRef<HTMLDivElement>(null);let timeout: ReturnType<typeof setTimeout> | undefined;const loadMoreRecords = () => {if (records.length < employees.length) {setLoading(true);timeout = setTimeout(() => {setRecords(employees.slice(0, records.length + batchSize));setLoading(false);}, 1000);}};const reset = () => {setRecords(employees.slice(0, batchSize));// Make sure to scroll to top after resetting recordsscrollViewportRef.current?.scrollTo(0, 0);};// Clear timeout on unmountuseEffect(() => {return () => {if (timeout) clearTimeout(timeout);};}, [timeout]);return (<><DataTablewithBorderborderRadius="sm"height={300}columns={[{ accessor: 'firstName' }, { accessor: 'lastName' }, { accessor: 'email' }]}records={records}fetching={loading}onScrollToBottom={loadMoreRecords}scrollViewportRef={scrollViewportRef}/><Group mt="sm" mx="xs" position="apart"><Text size="sm">Showing {records.length} records of {employees.length}{records.length < employees.length && ', scroll to bottom to load more'}</Text><Button variant="light" onClick={reset}>Reset records</Button></Group></>);}