Import Technical Reference
Data Import Options
DataImportOptions
Options for managing the Data Import function
Custom File Handlers to use for Data Import
(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.
(text: string) => T[] | Promise<T[]>
Handles Importing Data using text
(context:DataImportValidateContext<T>) =>DataImportValidationError[] | undefined
Function to validate the Imported Data
(context:GetPrimaryKeyValueContext<T>) => string | number
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
(context:PreprocessRowDataContext<T>) => Record<string, any>
Function to pre-process the data before it is imported
It might change in a future version
fileHandlers entries are a DataImportFileHandler:
DataImportFileHandler
Files that can be handled by Data Import
string
Name of File Extension
(file: File) => Promise<T[]>
Async function which handles the import returning a Data Record
handleImportedData receives a HandleImportedDataContext:
HandleImportedDataContext
Context used when importing Data
T[]
Data which has been imported
Custom application Context provided in AdaptableOptions.adaptableContext
validate receives a DataImportValidateContext and returns DataImportValidationError objects:
DataImportValidateContext
Context passed to the validate function
Imported Row Data
Custom application Context provided in AdaptableOptions.adaptableContext
DataImportValidationError
Defines a Validation Error
Data Import API
DataImportApi
Data Import. Opens the wizard that imports rows into the grid.
void
Opens the Data Import Wizard
Data Imported Event
The Data Imported Event is published whenever data has been imported.
DataImportedInfo
The DataImportedInfo object returned by the Event contains details of the rows which have been added and / or updated by the Import.
DataImportedInfo
Payload of the DataImported event.
Fires after a data import has been applied to the grid.
Extends , so adaptableApi is included.
IRowNode[]
Row nodes created by this import.
any[]
Raw rows that were imported, before they were matched to grid rows.
IRowNode[]
Existing row nodes updated by this import.
Custom application Context provided in AdaptableOptions.adaptableContext
Event Subscription
Subscribing to the Event is done the same way as with all Adaptable Events:
api.eventApi.on('DataImported', (eventInfo: DataImportedInfo) => {
// do something with the info
});