DataImportOptions

Options for managing the Data Import function

TypeScript
export interface DataImportOptions<T = Record<string,

Properties

PropertyTypeDescription
fileHandlersDataImportFileHandler<T>[]Custom File Handlers to use for Data Import
handleImportedData(context:HandleImportedDataContext<T>) => Promise<void |HandleImportedDataResolution>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.
textHandler(text: string) => T[] | Promise<T[]>Handles Importing Data using text
validate(context:DataImportValidateContext<T>) =>DataImportValidationError[] | undefinedFunction to validate the Imported Data
_getPrimaryKeyValue(context:GetPrimaryKeyValueContext<T>) => string | numberFunction to get the Primary Key value for a data row (defaults to value of the primaryKey column)
_preprocessRowData(context:PreprocessRowDataContext<T>) => Record<string, any>Function 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>