Class clove::AjaxAsyncDatasource

class clove::AjaxAsyncDatasource : public clove::AsyncDatasource, public clove::Headersource

A clove::AsyncDatasource implementation which uses Ajax requests for data retrieval and modification.

Public Functions

AjaxAsyncDatasource(config)

The ajax configuration may contain:

  • data_pullUrl: The url for data retrieval.

  • data_pushUrl: The url for data modification.

  • data_pullParams: Additional parameters for data retrieval.

  • data_pushParams: Additional parameters for data modification.

  • data_params: Additional parameters.

  • data_mayHaveChildren: If the data items might have children.

  • data_autoPullCharily: If automatic data fetching should be less aggressive.

  • params: Additional parameters.

  • rootType: The root type. This controls the prefix of the url and parameter keys to consider

  • ajaxAdditionalArgs: Additional arguments for the ajax request.

  • answerIdKeyName: The key name for the identification column used in reading server answers.

  • requestIdKeyName: The key name for the identification used in requests.

  • headerConfigs: Additional static header configurations. for fetching the first (and often only) level of objects. Instead of data_, other prefixes are allowed as well. The return type name of an retrieved object controls which prefix to use for fetching child objects.

    Parameters
    • config: The Ajax configuration.

OnDataArrived

Triggered when new data arrived from the server.

This is a clove.Event instance. See Manual for details.

getAjaxId(ptr)

Returns the Ajax id for a data cell.

Parameters

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

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

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: A function() called when the operation is completed and reflected in this datasource.

  • onfailed: A function(error) called when an error occurred.

  • reason: An optional custom object which can be used by observers for custom decisions.

    Parameters

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

clearCache()

Clears the internal caches.

getValue(ptr)

Returns the value for a given node.

Parameters

getMetadata(ptr)

Returns an object of metadata information (like icons, status infos used for styling, …). Optional.

Parameters

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

rowCount(parent)

Returns the number of rows for a given node.

Parameters

columnCount(parent)

Returns the number of columns for a given node.

Parameters

valuePointer(irow, icol, parent)

Constructs and returns a clove::DatasourceValuePointer for a given node.

Parameters

parent(ptr)

Returns the parent node for a given node.

Parameters

valuePointerNavigateInDepth(ptr, direction, mayexpandfct)

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: A function(ptr) which returns true 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

getColumnHeader(irow, parent)

Returns the header configuration for a given column.

Parameters

rowHeadersVisible(parent)

If row headers are visible.

Parameters

columnHeadersVisible(parent)

If column headers are visible.

Parameters

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.

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.