Skip to content

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

PropertyModifierTypeDescriptionDefined in
_columnspublicColumnDef<TOriginalRow, TMeta>[]Processed columns for internal use.core/index.svelte.ts:53
cacheManagerpublicDatagridCacheManager<TOriginalRow>Cache management for the datagrid.core/index.svelte.ts:76
columnspublicColumns<TOriginalRow>Column management instance.core/index.svelte.ts:58
eventsreadonlyEventServiceEvent service for managing event subscriptions and emissions.core/index.svelte.ts:25
featurespublicDatagridFeatures<TOriginalRow>Feature manager for enabling/disabling specific datagrid features.core/index.svelte.ts:103
gridIdentifierpublicanyUnique identifier for the grid instance.core/index.svelte.ts:40
handlersreadonlyHandlersManagerManages event handlers for the grid.core/index.svelte.ts:35
lifecycleHookspublicLifecycleHooks<TOriginalRow>Lifecycle hooks for pre/post processing operations.core/index.svelte.ts:108
measurePerformancepublicbooleanWhether to measure performance metrics for grid operations.core/index.svelte.ts:81
originalStatepublicanyStores the original state of the datagrid, including columns and data.core/index.svelte.ts:45
performanceMetricsreadonlyPerformanceMetricsPerformance metrics tracker.core/index.svelte.ts:30
processorspublicobjectData and column processing managers.core/index.svelte.ts:68
processors.columnpublicColumnProcessor<TOriginalRow>-core/index.svelte.ts:70
processors.datapublicDataDataProcessor<TOriginalRow>-core/index.svelte.ts:69
rowIdGetterpublic(row: TOriginalRow) => GridRowIdentifierFunction to retrieve the row identifier.core/index.svelte.ts:88
rowIndexGetterpublic(row: TOriginalRow, parentIndex: string, index: number) => stringFunction to retrieve the row index.core/index.svelte.ts:97
rowspublicRows<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 });