Interface: dataControlInterface

dataControlInterface

Hypergrid's data source objects transform data row collections (for example, by indexing them). These might include filter data sources that hide data rows and sorter data sources that rearrange data rows.

Later, the transformations are executed (by reindex). The apply method of each data source is called in turn. For example, a filtering data source's apply method would call its controller's test method, once for each data row (typically to build an index of included rows).

Methods

properties(properties) → {undefined|null|*}

Column property accessor.

There are two types of calls:

  • "Getter" call - when properties.GETTER is defined
  • "Setter" call - when properties.GETTER is not defined

For "setter" calls only: Assigns the values of all enumerable members of properties to the data controller properties with the same names, with the following exceptions:

  • Value is a function - Functions should be executed by your implementation to get the actual value to be assigned to the data controller. (If you data controller has properties that are themselves functions and need to be able to have functions assigned to them, it is your responsibility to make exceptions to this rule for such properties.)

Note: The COLUMN and GETTER and name properties are reserved.

Parameters:
Name Type Description
properties object

Contains property values to assign to the data controller. This object is required. However, none of the following options are required.

Properties
Name Type Attributes Description
COLUMN object <optional>

If defined, value(s) pertain to the indicated column only. If omitted, value(s) pertain to the whole data controller.

Note that dataModels.JSON#prop defines COLUMN as non-enumerable. This makes it easy for your helper data controller's properties method implementation to ignore it.

Properties
Name Type Attributes Description
index object <optional>

Column index as defined by dataSource.getFields().

name object <optional>

Column name as defined in dataSource.getFields().

GETTER string <optional>

"Get" (return) the value of the property with the supplied name. If undefined,return null. (All other members of properties are ignored.)

Returns:

One of:

  • Setter: undefined
  • Getter:
    • Property value (when the property name in GETTER is defined in the data controller).
    • null (when the property name in GETTER is not defined in the data controller).
    • undefined when COLUMN is defined but the column it specifies is not found.
Type
undefined | null | *