Data Adapters
In CxJS, data adapters are used under the hood to convert raw data into a format that can be easily
consumed by various components such as Grid, List, Repeater, or those like Tree Grid with tree
structure. Data adapters come in three types: array adapter, group adapter, and tree adapter.
Array Adapter
Transforms flat lists through operations such as mapping or sorting. See Repeater for more.
| Property | Description | Type |
|---|---|---|
indexName | Alias used to expose record index. Defaults to | string |
keyField | Configures which field forms the record key. | string |
recordName | Alias used to expose record data. Defaults to | string |
recordsBinding | Specifies the location for storing records. | string |
immutable | Indicate that the data in the parent store should not be mutated. Defaults to | boolean |
recordsAccessor | Configuration for accessing and modifying records data. | object |
sealed | Indicate that the data in record stores should not be mutated. | boolean |
Group Adapter
Groups data based on the provided key. Used in components such as List and Grid.
See grouping in lists for more.
| Property | Description | Type |
|---|---|---|
aggregates | Defines computed values based on grouped records, e.g. count of elements in a group. | record |
groupName | Alias used to expose group data. Defaults to | string |
groupRecordsAlias | Alias used to expose group records data outside the group. | string |
groupRecordsName | Alias used to expose records data within a group. Defaults to | string |
groupings | Configures criteria for hierarchically grouping records. Allows configuring header and footer. | object |
indexName | Alias used to expose record index. Defaults to | string |
keyField | Configures which field forms the record key. | string |
recordName | Alias used to expose record data. Defaults to | string |
recordsBinding | Specifies the location for storing records. | string |
immutable | Indicate that the data in the parent store should not be mutated. Defaults to | boolean |
recordsAccessor | Configuration for accessing and modifying records data. | object |
sealed | Indicate that the data in record stores should not be mutated. | boolean |
sortOptions | Options for data sorting. See Intl.Collator options for more info. | record |
Tree Adapter
Structures data in a tree-like format, enabling the expansion of individual records. See Tree Grid for more.
| Property | Description | Type |
|---|---|---|
childrenField | Alias used to expose children data. Default is | string |
foldersFirst | A boolean value indicating whether folders should be displayed before leaves. Defaults to | boolean |
indexName | Alias used to expose record index. Defaults to | string |
keyField | Configures which field forms the record key. | string |
recordName | Alias used to expose record data. Defaults to | string |
recordsBinding | Specifies the location for storing records. | string |
expandedField | Alias pointing to a boolean value indicating the record's expansion status. Defaults to | string |
hideRootNodes | If | boolean |
immutable | Indicate that the data in the parent store should not be mutated. Defaults to | boolean |
leafField | Alias pointing to a boolean value indicating whether the node is leaf. Defaults to | string |
loadedField | Alias pointing to a boolean value indicating whether the node has loaded its children. Defaults to | string |
loadingField | Alias pointing to a boolean value indicating whether the node is currently loading its children. Defaults to | string |
onLoadError | An error occured while loading the children data. | function |
recordsAccessor | Configuration for accessing and modifying records data. | object |
restoreExpandedNodesOnLoad | A boolean flag that determines whether the expanded state of the nodes should be restored when the data is loaded. | boolean |
sealed | Indicate that the data in record stores should not be mutated. | boolean |
These adapters serve specific purposes in manipulating and organizing data for integration with CxJS components, providing a flexible and efficient way to handle various data structures across different application needs.