Table
Represents table object (usually it’s value of table DCI).
Instance attributes
- columnCount: int
-
Number of columns.
- columns: Array<TableColumn>
-
Array of column definitions.
- instanceColumns: Array<TableColumn>
-
Array of column definitions including only columns marked as instance columns.
- instanceColumnIndexes: Array<Integer>
-
Array with indexes of columns marked as instance columns.
- rowCount: int
-
Number of rows.
- rows: Array<TableRow>
-
Array of rows with data.
- title: String
-
Title of table.
Instance methods
- addColumn(name, [type], [displayName], [isInstance]): int
-
Adds column to table
Table 1. Parameters name
String
Column name
type
Integer
Data type, optional parameter. Default is String
displayName
String
Column display name
isInstance
Boolean
Trueif column is instance columnReturnColumn index
- addRow(): int
-
Adds row to table
ReturnRow index
- deleteColumn(columnId): void
-
Delete column
Table 2. Parameters columnId
Integer
Column index
- deleteRow(rowId): void
-
Delete row
Table 3. Parameters rowId
Integer
Row index
- findRowByInstance(instance, instance2, …) ⇒ TableRow
-
Finds row by instance
Table 4. Parameters instance
String
Instance string
instance2
String
Optional. If instance is composed of several columns, these can be supplied as additional parameters.
ReturnTable row that corresponds to provided instance
- findRowIndexByInstance(instance, instance2, …): int
-
Finds row index by instance
Table 5. Parameters instance
String
Instance string
instance2
String
Optional. If instance is composed of several columns, these can be supplied as additional parameters.
ReturnTable row index corresponds to provided instance
- get(rowId, columnId): String
-
Get cell value by row and column id
Table 6. Parameters rowId
Integer
Row index
columnId
Integer
Column index
ReturnCell value as string
- getColumnIndex(columnName): int
-
Get column index by column name
Table 7. Parameters columnName
String
Column name
ReturnColumn index or -1 if column not found
- getColumnName(columnId): String
-
Get column name by column index
Table 8. Parameters columnName
Integer
Column name
ReturnColumn name or empty string if no column with given index
- print(): void
-
Prints formatted table with header and contents
- set(rowId, columnId, value): void
-
Set column value by row and column index
Table 9. Parameters rowId
Integer
Row index
columnId
Integer
Column index
value
String
New value
ReturnColumn index
- trace(tag, level, prefix, headers, delimiter): void
-
Dump formatted table to log
Table 10. Parameters tag
String
Target debug level, default "nxsl.trace"
level
Integer
Target debug level, default "0"
prefix
String
Optional target prefix; will be added before each line in log file, default 'NULL'
headers
Bolean
Optional target header, default 'true'
delimiter
String
Optional record separator, default ','