Constructor
new DataTable()
- Copyright:
- ParaSQL LLC 2013-2022. All rights reserved.
- License:
Example
// get the first for from myDataWidget
let dataRow = myDataWidget.getDataTable().getRowAt(0);
Extends
- Object
Members
columns :Array.<parasql.schema.ColumnInfo>
Type:
- Array.<parasql.schema.ColumnInfo>
rows :Array.<parasql.schema.DataRow>
Type:
- Array.<parasql.schema.DataRow>
Methods
addNewColumn(columnName, datatype) → {parasql.schema.ColumnInfo}
Parameters:
Name | Type | Description |
---|---|---|
columnName |
string | |
datatype |
string | A valid database datatype (e.g. varchar, double, int) |
Returns:
appendNewRow() → {parasql.schema.DataRow}
Adds a new row to the end of this DataTable.
- Description:
Adds a new row to the end of this DataTable.
Returns:
The newly added row.
clearAllRows()
Clears all rows from this DataTable.
- Description:
Clears all rows from this DataTable.
discardChanges()
Tells each Row in this DataTable to discardChanges.
- Description:
Tells each Row in this DataTable to discardChanges.
getColumns() → {Array.<parasql.schema.ColumnInfo>}
Returns:
- Type
- Array.<parasql.schema.ColumnInfo>
getIndexOf(columnName) → {number}
Parameters:
Name | Type | Description |
---|---|---|
columnName |
string | The name of the column. |
Returns:
The index of the column with the specified name, or -1 if no matching column was found.
- Type
- number
getRowAt(index) → {parasql.schema.DataRow}
Parameters:
Name | Type | Description |
---|---|---|
index |
number | The index of the row to return. The first row is 0. |
Returns:
getRowCount() → {number}
Returns:
The number of rows in this DataTable.
- Type
- number
getRows() → {Array.<parasql.schema.DataRow>}
Returns:
- Type
- Array.<parasql.schema.DataRow>
getTotalRowCount() → {number}
This value is only set if SQL_CALC_FOUND_ROWS was used.
- Description:
This value is only set if SQL_CALC_FOUND_ROWS was used.
Returns:
The total number of rows that would have been retrieved if no LIMIT clause was used; this is an optionally calculated number and will be -1 if not set.
- Type
- number
getValue(rowIndex, colName) → {parasql.schema.DataValue}
Parameters:
Name | Type | Description |
---|---|---|
rowIndex |
number | The first row in the table has index = 0 |
colName |
string | The column name |
Returns:
insertRowAt(index) → {parasql.schema.DataRow}
Parameters:
Name | Type | Description |
---|---|---|
index |
number | The position of the newly inserted row within this DataTable; index must be between 0 and DataTable.rows.length inclusive. |
Returns:
The newly inserted row.
isDirty() → {boolean}
Returns:
Returns true if this DataTable is dirty (contains new rows, deleted rows, or rows with changed values).
- Type
- boolean
markAsSaved()
Marks this DataTable as having saved it changes to the database.
- Description:
Marks this DataTable as having saved it changes to the database.
toCSV(optionsnullable) → {string}
Generates a CSV representation of this DataTable.
- Description:
Generates a CSV representation of this DataTable.
See IETF RFC 4180 for official CSV format: http://tools.ietf.org/html/rfc4180#page-2
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<nullable> |
Properties
|
Returns:
The CSV representation of this DataTable.
- Type
- string