Class clove::AsyncDatasource¶
-
class
clove
::
AsyncDatasource
: public clove::Datasource, public clove::Headersource A clove::Datasource implementation which supports asynchronous data operations like Ajax requests.
Subclassed by clove::AjaxAsyncDatasource
Public Functions
-
AsyncDatasource
(config) The configuration may contain:
'errorhandler'
: Optionalfunction(error)
as fallback error handler.'cacheAge'
: The maximum cache age in seconds.- Parameters
config
: The async datasource configuration.
-
do_async_pull
(ptr, requestConfig) Executes an asynchronous data modification.
Do not call this from outside, use clove::AsyncDatasource::async_pull() instead.
Override this method in custom implementations.
- Parameters
ptr
: The clove::DatasourceValuePointer.requestConfig
: The request configuration. See clove::AsyncDatasource::async_pull() for details.
-
do_async_push
(ptr, v, requestConfig) Executes an asynchronous data retrieval.
Do not call this from outside, use clove::AsyncDatasource::async_push() instead.
Override this method in custom implementations.
- Parameters
ptr
: The clove::DatasourceValuePointer.v
: The new value.requestConfig
: The request configuration. See clove::AsyncDatasource::async_pull() for details.
-
async_pull
(ptr, requestConfig) Asynchronously modifies a data value.
Do not override this in custom implementations, use clove::AsyncDatasource::do_async_pull() instead.
requestConfig
may contain:onsuccess
: Afunction()
called when the operation is completed and reflected in this datasource.onfailed
: Afunction(error)
called when an error occurred.reason
: An optional custom object which can be used by observers for custom decisions.- Parameters
ptr
: The clove::DatasourceValuePointer.requestConfig
: The request configuration.
-
async_push
(ptr, v, requestConfig) Asynchronously retrieves a data value.
Do not override this in custom implementations, use clove::AsyncDatasource::do_async_push() instead.
- Parameters
ptr
: The clove::DatasourceValuePointer.v
: The new value.requestConfig
: The request configuration. See clove::AsyncDatasource::async_pull() for details.
-
clearCache
() Clears the internal caches.
-
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.
-