FAQ
Frequently asked questions
FAQ
Frequently asked questions about gp-grid-react.
General
What browsers are supported?
gp-grid supports all modern browsers:
- Chrome/Edge 88+
- Firefox 78+
- Safari 14+
Is gp-grid free to use?
Yes, gp-grid is open source and free to use in both personal and commercial projects.
What's the maximum dataset size?
There's no practical limit. The virtual scrolling architecture means performance is consistent regardless of dataset size. We've tested with 2 million rows.
Performance
Why is my grid slow to render?
Common causes:
-
Not using memoization: Wrap
rowDatainuseMemo:const rows = useMemo(() => data.map(transform), [data]); -
Heavy custom renderers: Keep renderers simple, pre-compute values.
-
Too many columns: Consider horizontal virtualization for 50+ columns.
How do I improve scroll performance?
- Increase
overscanfor smoother scrolling (at cost of more DOM nodes) - Simplify custom renderers
- Ensure container has explicit dimensions
Styling
How do I style alternating rows?
.gp-grid-row:nth-child(even) {
background-color: rgba(0, 0, 0, 0.02);
}How do I change selection colors?
.gp-grid-cell--active {
outline-color: #your-color;
}
.gp-grid-cell--selected {
background-color: rgba(your-rgb, 0.1);
}Data
How do I update a single cell?
Use a mutable data source:
const dataSource = createMutableClientDataSource(data, {
getRowId: (row) => row.id,
});
dataSource.updateCell(rowId, "fieldName", newValue);How do I refresh data from the server?
For server data sources, the grid automatically fetches when sort/filter changes. For manual refresh, recreate the data source:
const [key, setKey] = useState(0);
// Refresh
setKey(k => k + 1);
return <Grid key={key} dataSource={dataSource} ... />;Can I use async data loading?
Yes, use createServerDataSource which accepts an async function.
Features
Does gp-grid support column resizing?
Column resizing is on the roadmap. Currently, columns have fixed widths defined in the column definition.
Does gp-grid support row grouping?
Row grouping is planned for a future release.
Can I export to Excel/CSV?
Export functionality is not built-in. You can access the data source and implement export yourself:
const exportToCSV = () => {
const rows = dataSource.getAllRows(); // Your implementation
// Convert to CSV and download
};Troubleshooting
Grid shows no data
- Check that
rowDataordataSourceis provided - Verify the container has explicit height
- Check browser console for errors
Cells don't render correctly
- Ensure
fieldin column definition matches property name in data - Check
cellDataTypematches actual data type
Sorting doesn't work
- Verify
sortingEnabledis not set tofalse - Check column has
sortable: true(default) - For server-side data, ensure server handles sort request