new DataSourceOrigin()
See DataSourceOrigin#initialize
for constructor parameters.
Members
schema :Array.<columnSchemaObject>
The array of column schema objects.
Type:
- Array.<columnSchemaObject>
schema :Array.<columnSchemaObject>
The array of uniform data objects.
Type:
- Array.<columnSchemaObject>
Methods
findRow(columnName, valueopt, replacementopt) → {object|number|undefined}
Find, replace, or update a row by it's primary key column.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
columnName |
string | object | One of:
|
|
value |
Array.<string> | * |
<optional> |
One of:
omitted - When |
replacement |
object | null | undefined |
<optional> |
One of:
|
- To Do:
-
- Use a binary search (rather than `Array..find`) when column is known to be indexed (sorted).
Returns:
One of:
undefined
- data row not found- object - found data row object (will have been deleted if
replacement
wasnull
) - number - index of found data row object in
this.data
(ifreplacement
wasundefined
)
- Type
- object | number | undefined
findRowByIndex(index, replacementopt) → {object|number|undefined}
Find, replace, or update a row by it's index.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
index |
number | Row index that is being accessed |
|
replacement |
object | null | undefined |
<optional> |
One of:
|
- To Do:
-
- Use a binary search (rather than `Array..find`) when column is known to be indexed (sorted).
Returns:
One of:
undefined
- data row not found- object - found data row object (will have been deleted if
replacement
wasnull
)
- Type
- object | number | undefined
getColumnCount() → {number}
Returns:
- Type
- number
getFields() → {Array.<number>}
Returns:
- Type
- Array.<number>
getHeaders() → {Array.<string>}
Returns:
- Type
- Array.<string>
getRow(y) → {dataRowObject}
Parameters:
Name | Type | Description |
---|---|---|
y |
Returns:
- Type
- dataRowObject
getRowCount() → {number}
Returns:
- Type
- number
getSchema() → {Array.<columnSchemaObject>}
Returns:
- Type
- Array.<columnSchemaObject>
getValue(x, y) → {*}
Parameters:
Name | Type | Description |
---|---|---|
x |
||
y |
Returns:
- Type
- *
setData(dataopt, schemaopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
data |
Array.<object> |
<optional> |
[] | Array of uniform objects containing the grid data. |
schema |
Array.<columnSchemaObject> |
<optional> |
[] |
setFields(fields)
Parameters:
Name | Type | Description |
---|---|---|
fields |
Array.<string> |
setHeaders(headersopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
headers |
Array.<string> |
<optional> |
If omitted, headers will be reset to their derived defaults on next call to |
setValue(x, y, value)
Parameters:
Name | Type | Description |
---|---|---|
x |
number | |
y |
number | |
value |