Class: DataTable

parasql.schema.DataTable()

new DataTable()

DataTable class.
Example
var dataRow = myDataWidget.getDataTable().getRowAt(0); // get the first row from myDataWidget 

Extends

  • Object

Members

rows :Array.<parasql.schema.DataRow>

Type:
Since:
  • v64

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:
Type
parasql.schema.ColumnInfo

appendNewRow() → {parasql.schema.DataRow}

Adds a new row to the end of this DataTable.
Returns:
The newly added row.
Type
parasql.schema.DataRow

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:
Type
parasql.schema.DataRow

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.
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:
Type
parasql.schema.DataValue

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.
Type
parasql.schema.DataRow

isDirty() → {boolean}

Returns:
Returns true if this DataTable is dirty (contains new rows, deleted rows, or rows with changed values).
Type
boolean

toCSV(optionsnullable) → {string}

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
Name Type Description
excludeHeader boolean If true the header row will be excluded.
fieldDelimiter string Specify a custom field delimiter; the default is the comma character.
Returns:
The CSV representation of this DataTable.
Type
string