DataImportOptions

Options for managing the Data Import function

TypeScript
export interface DataImportOptions<T = Record<string,

Properties

PropertyDescription
fileHandlersCustom File Handlers to use for Data Import
handleImportedDataFunction to handle the Imported Data and apply it to the Grid. If not provided then the Data will be applied to the Grid automatically.
textHandlerHandles Importing Data using text
validateFunction to validate the Imported Data
_getPrimaryKeyValueFunction to get the Primary Key value for a data row (defaults to value of the primaryKey column)
_preprocessRowDataFunction to pre-process the data before it is imported

Property Details

fileHandlers

Custom File Handlers to use for Data Import

TypeScript
fileHandlers?: DataImportFileHandler<T>[];
Property Value

DataImportFileHandler<T>[]

handleImportedData

Function to handle the Imported Data and apply it to the Grid. If not provided then the Data will be applied to the Grid automatically.

TypeScript
handleImportedData?: (context: HandleImportedDataContext<T>) => Promise<void | HandleImportedDataResolution>;
Property Value

(context:HandleImportedDataContext<T>) => Promise<void |HandleImportedDataResolution>

textHandler

Handles Importing Data using text

TypeScript
textHandler?: (text: string) => T[] | Promise<T[]>;
Property Value

(text: string) => T[] | Promise<T[]>

validate

Function to validate the Imported Data

TypeScript
validate?: (context: DataImportValidateContext<T>) => DataImportValidationError[] | undefined;
Property Value

(context:DataImportValidateContext<T>) =>DataImportValidationError[] | undefined

_getPrimaryKeyValue

Function to get the Primary Key value for a data row (defaults to value of the primaryKey column)

It might change in a future version

TypeScript
_getPrimaryKeyValue?: (context: GetPrimaryKeyValueContext<T>) => string | number;
Property Value

(context:GetPrimaryKeyValueContext<T>) => string | number

_preprocessRowData

Function to pre-process the data before it is imported

It might change in a future version

TypeScript
_preprocessRowData?: (context: PreprocessRowDataContext<T>) => Record<string, any>;
Property Value

(context:PreprocessRowDataContext<T>) => Record<string, any>