Replies: 4 comments
-
Can you clarify what is there to lazy load? |
Beta Was this translation helpful? Give feedback.
-
I mean loading data from backend when you scroll down, or set some filters. E.g I have 100 000 rows by don't want to load them all since it's a lot of data and takes too long. |
Beta Was this translation helpful? Give feedback.
-
Could try something like this with useSWR: https://swr.vercel.app/ function LazyFormatter(props) {
const { data } = useSWR(`/api/row/${props.row.id}`);
if (!data) return null;
return <>{data.name}</>;
}
function MyGrid() {
const rows = [{ id: 1 }];
return <DataGrid columns={columns} rows={rows} defaultColumnOptions={{ formatter: LazyFormatter }} />;
} |
Beta Was this translation helpful? Give feedback.
-
You can also use the |
Beta Was this translation helpful? Give feedback.
-
Is there some example with lazy loading. Or how to implement lazy loading ?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions