setDpeNames

Defines columns and a list of datapoint elements to define the table to view. Either this or setQuery needs to be called in order to initialize this instance.

Synopsis

bool setDpeNames(const dyn_mapping &columnDefs,
                   const dyn_string &dpeList,
                   const dyn_string idList = makeDynString(),
                   const string dptName = "")

Parameters

Parameter Meaning
columnDefs

Definition of the table's columns.

For each column, this parameter contains a mapping with the following keys. (For each key, a constant is defined as well, see the code example in setQuery) :
"_config"
Name of the config (or element) that should be shown in this table (this will be added to the SELECT clause of the query that feeds this table with data). If this is omitted, both "_colID" and "_convert" must be set, in this case, the convert method is evaluated once for each row to provide static data for this column.
"_colID"
ID for this column, will be used in update callbacks and for definitions of sorting or filtering. If omitted, the value stored under "_config" will also be used as column ID.
"_convert"
A method on the receiver set with the constructor that converts the values for this column from the actual value to the final value to be used in the table, or, when "_config" is not present, returns a static value for this column. The method must have the following signature:
type name(const anytype &userData, const string &rowId, const string &colId[, const anytype &value]) 
type
Return type of the method.
name
Name of the method.
userData
User data that has been passed with this constructor.
rowId
ID of the row for which the value will be converted or static data should be created.
colId
ID of the column for which the value will be converted or static data should be created.
value
The value to convert (will be 0 for static data). This function must return the converted value that will be included in the tables data instead of the original `value` or the static value to be used for this column.
"_hidden"
If "true", this column is processed as every other column, but its values are never included in updates. It still can be used for sorting and filtering, which is the main purpose to have such a column.
"_fastUpdate"
If "true", this column should be optimized for frequent value updates. These columns cannot be used for sorting and filtering, but are therefore handled more efficiently when being updated. However, changing the set of visible rows is less efficient if such columns are present. Note also that at least one column must exist where "_config" is set and this flag is not `true`.
dpeList List of DPE names, each DPE defines one row of the table.
idList (optional) List of IDs used instead of the DPE names in callbacks. Each ID is used for the DPE at the same index and must be unique.
dptName (optional) When the column definitions contain datapoints and not only configs, all results need to have the same datapoint type, which needs to be specified with this parameter. It can be omitted when all columns contain pure configs.

Return value

Returns "true" when the query could be generated and started successfully.

  dyn_string dps = makeDynString("ExampleDP_Arg1.", "ExampleDP_Arg2.", "ExampleDP_Result.");
  dyn_string ids = makeDynString( "Arg1", "Arg2", "Result");
  view.setDpeNames(columns, dps, ids);

Assignment

DynamicTableView

Availability

CTRL