Virtual Data (FnDataSource)
Overview
FnDataSource generates cell values on demand via a closure. It uses O(1)
memory regardless of the row count — ideal for computed data, demos, or
very large datasets.
Creating
Properties
Note
*Editing still works via the patches layer on GridModel. The patch
overrides the closure result for that cell. See Data Model.
Sharing with Rc
Since FnDataSource cannot be cloned, wrap the GridModel in Rc if
you need to share it:
When to use
- Very large datasets (millions or billions of rows)
- Deterministic/computed data (hashes, formulas)
- Demo and testing scenarios
- When memory is constrained
When NOT to use
- When you need mutable data without patches
- When you need to clone the data source
- Server-side data with async loading — use
PageCacheDataSource