Import Technical Reference

Summary

  • Importing is set through Options
  • The Data Import API contains functions to manage exporting and reports progammatically
  • Import Event
  • There is no Initial Adaptable State associated with Data Import

Data Import Options

The Data Import Options section of Adaptable Options contains these 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

Data Import API

The Data Import API section of Adaptable API contains just one function which starts the Data Import Wizard:

MethodDescription
openImportWizard()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.

PropertyDescription
addedRowsRows that were added
importDataRaw data that was imported
updatedRowsRows that were updated
adaptableContextCustom 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
});