ImportOptions class (Tree)

ImportOptions()

new ImportOptions()

The ImportOptions type defines options to import data from CSV format. The Import() method imports data from CSV format. A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas.
ImportOptions

Members

(static) clear :boolean

The clear field specifies whether previously data of the control is cleared.
Type:
  • boolean
Example
false {boolean}, the control's data is not cleared by Import() method, so new data is appended
 true {boolean}, the control's data is cleared before import new data
clear

(static) columnCaption :string

The columnCaption field defines an expression that generates captions for new columns. The columnCaption field supports the following keywords:
index, returns the index of the column whose caption need to be generated
.
Type:
  • string
Example
"" {string}, no caption is provided for new columns
 "`import`" {string}, all columns are named `import`
 "index" {string}, the caption's index (0-based) is the caption of the column
 "`Column <b><off -2>` + (1 + index)" {string}, generates captions such as "Column 1", "Column 2", ... where the index (1-based) is displayed in bold up to the caption
columnCaption

(static) eof :string

The eof (EndOfField) field specifies the character to separate fields within the row/item/line (has effect only if format field is "CSV").
Type:
  • string
Example
"\t" {string}, specifies TAB charactar as field separator
 "," {string}, specifies comma charactar as field separator
eof

(static) eor :string

The eor (EndOfRow) field specifies the characters the row/item/line ends (has effect only if format field is "CSV").
Type:
  • string
Example
";" {string}, specifies that the ; character to end each row/item/line
 "\r\n" {string}, specifies that the \r\n sequence to end each row/item/line
eor

(static) format :string

The format field specifies the format of source to import data form.
Type:
  • string
Example
null {null}, specifies that the source of import is an array of [[value]] type
 "CSV" {string}, specifies that the source of import is a string in CSV format
format

(static) hdr :boolean

The hdr field specifies whether the first line indicates the control's header (has effect only if format field is "CSV").
Type:
  • boolean
Example
false {boolean}, specifies the no header line is provided
 true {boolean}, the first line defines the control's header
hdr

(static) ignoreXML :boolean

The ignoreXML field specifies whether the file is loaded as CSV even for .xml files (files of XML type).
Type:
  • boolean
Example
false {boolean}, indicates that an .xml file is loaded using the LoadXML() method, any other file is loaded as CSV file
 true {boolean}, no matter of file's extension the data is loaded as CSV file
ignoreXML

(static) limit :number

The limit field specifies the maximum number of rows/items/lines to import.
Type:
  • number
Example
undefined {undefined}, specifies unlimited number of rows/items/lines to import
 1000 {number}, limits the items to import to 1,000
limit

(static) parent :number|string|Item

The parent field defines the parent item the import data goes to. The parent field can be one of the following:
  • parent {number}, indicates a numeric value that defines the index of the parent's item (0-based)
  • parent {string}, specifies a string expression that defines the identifier/key of the parent's item
  • parent {Item}, specifies the object reference to the parent's item
.
Type:
  • number | string | Item
Example
0 {number}, the items to import are added as child-items of item with the index 0
parent

(static) str :string

The str field specifies the character to quote values (has effect only if format field is "CSV").
Type:
  • string
Example
"'" {string}, specifies ' character to quote any value that contains other ' or eof character
 "\"" {string}, specifies " character to quote any value that contains other " or eof character
str