List
Lists people, documents or records.
When to use
- Use it when a table would have only a few columns.
Examples
Open records
Loading the example
<k:List items="{path: '/rows', templateShareable: false}" press=".onPress"><k:ListItem key="{id}" title="{title}" text="{text}" meta="{amount}" state="{state}" person="{person}"/></k:List>sap.ui.define(["sap/ui/core/mvc/Controller", "kor/ui/Toast"], (Controller, Toast) => Controller.extend("sample.OpenRows", {
onPress(event) {
Toast.show(String(event.getParameter("key")));
}
}));Multiple selection
Loading the example
<k:List mode="multi" selectedKeys="a" label="Documents">
<k:ListItem key="a" group="Required" icon="file-text" title="Invoice"/>
<k:ListItem key="b" group="Required" icon="file-text" title="Waybill"/>
<k:ListItem key="c" group="Optional" icon="shield-check" title="Certificate"/>
</k:List>API
Properties
| Name | Type | Default | Description |
|---|---|---|---|
mode | string | none | none, single or multi |
selectedKeys | string[] | [] | Selected keys |
label | string | Accessible name | |
noData | string | Text for an empty list | |
divided | boolean | true | Whether to separate rows with lines |
Aggregations
| Name | Type | Description |
|---|---|---|
items | ListItem[] | Rows |
Events
| Name | Type | Description |
|---|---|---|
press | key: stringitem: object | A row was pressed |
selectionChange | keys: string[]key: string | The selection changed |
ListItem
A list row.
Properties
| Name | Type | Default | Description |
|---|---|---|---|
key | string | Key | |
title | string | Title | |
text | string | Description | |
meta | string | Value at the end of the row | |
icon | string | Icon | |
person | string | Person name. Shows an avatar instead of the icon | |
statusText | string | Status text | |
state | string | Status. Hidden when empty | |
group | string | Group heading. Rows of a group must be adjacent | |
enabled | boolean | true | Whether the row is enabled |