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, optional parameter
isInstance
Boolean
Trueif column is instance column, optional parameter. Default isfalseReturnColumn 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, or
nullif not found
- findRowIndexByInstance(instance): int
-
Finds row index by instance. Only a single argument is accepted; for an instance composed of several columns use findRowByInstance() (known issue, netxms#3783).
Table 5. Parameters instance
String
Instance string
ReturnIndex of the table row that corresponds to provided instance, or
-1if not found
- get(rowId, columnId): String
-
Get cell value by row and column id
Table 6. Parameters rowId
Integer
Row index
columnId
Integer or String
Column index or column name
ReturnCell value as string, or
nullif row or column does not exist
- 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 columnId
Integer
Column index
ReturnColumn name or
nullif 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 or String
Column index or column name
value
String
New value
- trace(tag, level, prefix, headers, delimiter): void
-
Dump formatted table to log
Table 10. Parameters tag
String
Debug tag;
"nxsl.trace"is used ifnulllevel
Integer
Debug level
prefix
String
Optional prefix that will be added before each line in log file, default is empty string
headers
Boolean
Optional, print header line with column names, default
truedelimiter
String
Optional field separator (first character of the string is used), default ','