DatagridCore
Defined in: core/index.svelte.ts:21
Core class for managing the datagrid, handling state, events, processing, and features.
Example
const datagrid = new DatagridCore({ columns: myColumns, data: myData });
Type Parameters
• TOriginalRow = any
The type of the original data row.
• TMeta = any
Additional metadata type for columns.
Constructors
new DatagridCore()
new DatagridCore<
TOriginalRow
,TMeta
>(config
,lazyInitialization
):DatagridCore
<TOriginalRow
,TMeta
>
Defined in: core/index.svelte.ts:119
Creates an instance of DatagridCore.
Parameters
config
DatagridCoreConfig
<TOriginalRow
>
The datagrid configuration.
lazyInitialization
boolean
= false
Whether to delay initialization.
Returns
DatagridCore
<TOriginalRow
, TMeta
>
Example
const grid = new DatagridCore({ columns: [...], data: [...] });
Properties
Property | Modifier | Type | Description | Defined in |
---|---|---|---|---|
_columns | public | ColumnDef <TOriginalRow , TMeta >[] | Processed columns for internal use. | core/index.svelte.ts:53 |
cacheManager | public | DatagridCacheManager <TOriginalRow > | Cache management for the datagrid. | core/index.svelte.ts:76 |
columns | public | Columns <TOriginalRow > | Column management instance. | core/index.svelte.ts:58 |
events | readonly | EventService | Event service for managing event subscriptions and emissions. | core/index.svelte.ts:25 |
features | public | DatagridFeatures <TOriginalRow > | Feature manager for enabling/disabling specific datagrid features. | core/index.svelte.ts:103 |
gridIdentifier | public | any | Unique identifier for the grid instance. | core/index.svelte.ts:40 |
handlers | readonly | HandlersManager | Manages event handlers for the grid. | core/index.svelte.ts:35 |
lifecycleHooks | public | LifecycleHooks <TOriginalRow > | Lifecycle hooks for pre/post processing operations. | core/index.svelte.ts:108 |
measurePerformance | public | boolean | Whether to measure performance metrics for grid operations. | core/index.svelte.ts:81 |
originalState | public | any | Stores the original state of the datagrid, including columns and data. | core/index.svelte.ts:45 |
performanceMetrics | readonly | PerformanceMetrics | Performance metrics tracker. | core/index.svelte.ts:30 |
processors | public | object | Data and column processing managers. | core/index.svelte.ts:68 |
processors.column | public | ColumnProcessor <TOriginalRow > | - | core/index.svelte.ts:70 |
processors.data | public | DataDataProcessor <TOriginalRow > | - | core/index.svelte.ts:69 |
rowIdGetter | public | (row : TOriginalRow ) => GridRowIdentifier | Function to retrieve the row identifier. | core/index.svelte.ts:88 |
rowIndexGetter | public | (row : TOriginalRow , parentIndex : string , index : number ) => string | Function to retrieve the row index. | core/index.svelte.ts:97 |
rows | public | Rows <TOriginalRow > | Row management instance. | core/index.svelte.ts:63 |
Methods
initializeGridState()
initializeGridState(
config
):void
Defined in: core/index.svelte.ts:137
Initializes the grid state based on the provided configuration.
Parameters
config
DatagridCoreConfig
<TOriginalRow
>
The datagrid configuration.
Returns
void
refresh()
refresh(
updateOperation
,options
):void
Defined in: core/index.svelte.ts:183
Refreshes the datagrid with optional recalculations.
Parameters
updateOperation
() => void
The update function.
options
The recalculation options.
recalculateAll?
boolean
recalculateGroups?
boolean
recalculatePagination?
boolean
Returns
void
Example
grid.refresh(() => { grid.rows.updateSomeData();}, { recalculateAll: true });