Class clove::NativeDatasource¶
-
class
clove
::
NativeDatasource
: public clove::Datasource, public clove::Headersource A clove::Datasource implementation which stores all data in-memory.
It provides an interface for populating it with data and can directly be constructed and used. It also implements clove::Headersource, so it can also carry row and column header configurations.
Public Functions
-
NativeDatasource
(config) The configuration object allows the following keys:
readonly
: If this datasource may be changed from outside.rowHeadersVisible
: If row headers shall be visible in presentation.columnHeadersVisible
: If column headers shall be visible in presentation.- Parameters
config
: A configuration object.
-
root
() The root node as clove::NativeDatasourceValue.
-
valuePointerToNativeNode
(ptr) Returns the clove::NativeDatasourceValue for a node.
- Parameters
ptr
: The clove::DatasourceValuePointer.
-
insertRow
(ir, parent) Inserts a new empty row.
- Parameters
ir
: The row index.parent
: The parent node as clove::DatasourceValuePointer.
-
insertColumn
(ic, parent) Inserts a new empty column.
- Parameters
ic
: The column index.parent
: The parent node as clove::DatasourceValuePointer.
-
appendRow
(parent) Appends a new empty row (like inserting to the end).
- Parameters
parent
: The parent node as clove::DatasourceValuePointer.
-
appendColumn
(parent) Appends a new empty column (like inserting to the end).
- Parameters
parent
: The parent node as clove::DatasourceValuePointer.
-
removeRow
(ir, parent) Removes a row.
- Parameters
ir
: The row index.parent
: The parent node as clove::DatasourceValuePointer.
-
removeColumn
(ic, parent) Removes a column.
- Parameters
ic
: The column index.parent
: The parent node as clove::DatasourceValuePointer.
-
setValue
(ptr, value) Sets a new value to a node.
- Parameters
ptr
: The clove::DatasourceValuePointer.value
: The new node value.
-
setRootValue
(value) Sets a new value to the root node.
This is just a shorter variant of
setValue(undefined, value)
(for scalar usage).- Parameters
value
: The new node value.
-
setMetadata
(ptr, key, value) Sets a metadata key for a node.
- Parameters
ptr
: The clove::DatasourceValuePointer.key
: The metadata key, like ‘icon’.value
: The new value.
-
setRowHeader
(irow, parent, headercfg) Sets a row header configuration.
- Parameters
irow
: The row index.parent
: The parent node as clove::DatasourceValuePointer.headercfg
: The header configuration.
-
setColumnHeader
(icol, parent, headercfg) Sets a column header configuration.
- Parameters
icol
: The column index.parent
: The parent node as clove::DatasourceValuePointer.headercfg
: The header configuration.
-
getValue
(ptr) Returns the value for a given node.
- Parameters
ptr
: The clove::DatasourceValuePointer.
-
getMetadata
(ptr) Returns an object of metadata information (like icons, status infos used for styling, …). Optional.
- Parameters
ptr
: The clove::DatasourceValuePointer.
-
changeValue
(ptr, value) Change the value for a given node.
This method is called from external places, e.g. when a user makes changes in a datasource-connected widget.
- Parameters
ptr
: The clove::DatasourceValuePointer.value
: The new value.
-
rowCount
(parent) Returns the number of rows for a given node.
- Parameters
parent
: The parent as clove::DatasourceValuePointer.
-
columnCount
(parent) Returns the number of columns for a given node.
- Parameters
parent
: The parent as clove::DatasourceValuePointer.
-
valuePointer
(irow, icol, parent) Constructs and returns a clove::DatasourceValuePointer for a given node.
- Parameters
irow
: The row index.icol
: The column index.parent
: The parent as clove::DatasourceValuePointer.
-
parent
(ptr) Returns the parent node for a given node.
- Parameters
ptr
: A node as clove::DatasourceValuePointer.
Returns a clove::DatasourceValuePointer resulting in the original one by navigation in depth.
- Parameters
ptr
: A node as clove::DatasourceValuePointer.direction
: The direction (+1 or -1).mayexpandfct
: Afunction(ptr)
which returnstrue
iff this node’s children are to be traversed.
-
OnDataInsert
Triggered when a node insertion takes place.
This is a clove.Event instance. See Manual for details.
-
OnDataRemove
Triggered when a node removal takes place.
This is a clove.Event instance. See Manual for details.
-
OnDataUpdate
Triggered when a node data update takes place.
This is a clove.Event instance. See Manual for details.
-
getRowHeader
(irow, parent) Returns the header configuration for a given row.
- Parameters
irow
: The row index.parent
: The parent node as clove::DatasourceValuePointer.
-
getColumnHeader
(irow, parent) Returns the header configuration for a given column.
- Parameters
irow
: The column index.parent
: The parent node as clove::DatasourceValuePointer.
-
rowHeadersVisible
(parent) If row headers are visible.
- Parameters
parent
: The parent node as clove::DatasourceValuePointer.
-
columnHeadersVisible
(parent) If column headers are visible.
- Parameters
parent
: The parent node as clove::DatasourceValuePointer.
-
OnHeaderDataInsert
Triggered when a new row or column of header data was inserted.
This is a clove.Event instance. See Manual for details.
-
OnHeaderDataRemove
Triggered when a row or column of header data was removed.
This is a clove.Event instance. See Manual for details.
-
OnHeaderDataUpdate
Triggered when header data were updated.
This is a clove.Event instance. See Manual for details.
-
OnHeaderVisibilityUpdated
Triggered when header visibilities changed.
This is a clove.Event instance. See Manual for details.
-