ImportDataPanel

parasql.ui. ImportDataPanel

The ImportDataPanel class is used to prompt the user through the data import process.

Constructor

new ImportDataPanel(opts)

Since:
  • v66
License:
Example
// typical usage
let opts = {
	importIntoTable:'Customers',
	importAction:'INSERT',
	disabled: true,
	columnMap: [
		{sourceColName:'Customer_ID', targetColName:'Customer_ID'},
		{sourceColName:'Name', targetColName:'Customer_Name'},
		{sourceColName:'Address', targetColName:'Customer_Address'} 
	]   
};
new parasql.ui.ImportDataPanel(opts).show();
Parameters:
Name Type Description
opts Object

Various import options.

Properties
Name Type Description
importIntoTable string

The name of the table to import the data into.

disabled boolean

Prevent the user from changing any of the import options other than the file to import.

importAction string

Either: INSERT, INSERT_GENERATE_KEYS, UPDATE, or INSERT_ON_DUPLICATE_KEY_UPDATE.

columnMap Array

Maps column names in CSV file (source) to column names in selected table (target).

Properties
Name Type Description
obj Object

Object holding map properties.

Properties
Name Type Description
sourceColName string

column name in CSV file.

targetColName string

column name in target table.

delimiter string

Default is ',' but automatically set by sniffing file.

dateFormat string

Default is 'MM/DD/YYYY' valid options: 'MM/DD/YYYY', 'MM-DD-YYYY', 'DD/MM/YYYY', 'DD-MM-YYYY', 'DD.MM.YYYY', 'YYYY-MM-DD'.

timeFormat string

Default is 'HH:mm:ss' valid options: 'HH:mm:ss', 'HH:mm', 'hh:mm:ss AM', 'hh:mm AM'.

dateTimeFormat string

Default is 'MM/DD/YYYY HH:mm:ss' valid options: 'MM/DD/YYYY HH:mm:ss', 'MM-DD-YYYY HH:mm:ss', 'DD/MM/YYYY HH:mm:ss', 'DD-MM-YYYY HH:mm:ss', 'YYYY-MM-DD HH:mm:ss'.

decimalSeparator string

Default is '.' valid options: '.', ','.

Extends

Methods

getContentDiv() → {HTMLElement}

Inherited From:
Returns:

Returns this panel's content div.

Type
HTMLElement

hide()

Hides this ModalPanel.

Description:
  • Hides this ModalPanel.

Inherited From:

show()

Displays this ModalPanel.

Description:
  • Displays this ModalPanel.

Inherited From: