CxJS

ArrayAdapter

import { ArrayAdapter } from 'cx/ui'; Copied

ArrayAdapter is the simplest data adapter, designed for flat lists. It handles sorting, mapping, and basic record operations. It’s the default adapter for Repeater.

<Repeater
  records={m.items}
  dataAdapter={{ type: ArrayAdapter }}
>
  <div text={m.$record.name} />
</Repeater>

Configuration

PropertyTypeDescription
recordNamestringAlias used to expose record data. Default is $record.
indexNamestringAlias used to expose record index. Default is $index.
keyFieldstringField used as the unique record key.
recordsBindingstringSpecifies the store path for records.
recordsAccessorobjectConfiguration for accessing and modifying records data.
immutablebooleanPrevents aliased data from being written to the parent store. Default is false.
sealedbooleanPrevents child components from writing aliased data to this adapter’s store.

See also: Data Adapters, Repeater