CxJS

Data Adapters

Data adapters transform raw data into formats that can be consumed by components like Grid, List, and Repeater. They handle operations such as sorting, grouping, and tree structure management.

Comparison

AdapterPurposeUse case
ArrayAdapterHandles flat lists with sorting and mappingSimple repeated content
GroupAdapterGroups records with headers, footers, and aggregatesGrouped lists, category views
TreeAdapterManages hierarchical data with expand/collapseTree grids, file browsers

Grid and List use GroupAdapter by default, while Repeater uses ArrayAdapter.

How to Choose

Use ArrayAdapter for simple repeated content without grouping. It’s the default adapter for Repeater.

Use GroupAdapter for grids and lists. It’s the default for Grid and List components and supports grouping records by one or more fields, displaying group headers and footers, and calculating aggregates like counts or sums.

Use TreeAdapter for hierarchical data with parent-child relationships. It manages expansion state and supports lazy loading of child nodes.