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:
| Property | Description |
|---|---|
| fileHandlers | Custom File Handlers to use for Data Import |
| 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. |
| textHandler | Handles Importing Data using text |
| validate | Function to validate the Imported Data |
| _getPrimaryKeyValue | Function to get the Primary Key value for a data row (defaults to value of the primaryKey column) |
| _preprocessRowData | Function 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:
| Method | Description |
|---|---|
| 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.
| Property | Description |
|---|---|
| addedRows | Rows that were added |
| importData | Raw data that was imported |
| updatedRows | Rows that were updated |
| adaptableContext | 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
});