Lists
One of the common requirements in widgets is to be able to show a list of items.
There are several ways in which lists can be displayed within the Experience Portal.
How you choose to display them depends on the nature of the data, how much data there is, and how users intend to use them.
Large lists of objects of the same type
This is a common scenario where you need to show many items in a list.
For example:
A list of requests made by a user
An audit trail of incidents that have occurred
There can be many items and there will usually be a filter UI to filter down data based on the selected criteria (creation date, assigned user, etc...)
For these use cases, a Data List can be used.
Data Lists can load either a fixed list of items or can asynchronously load data from Lucy and can paginate over results so more items are fetched as you scroll down the list.
Using fixed list of items
let data:any[] = [
{
"id": 1,
"name": "Name 01"
},
{
"id": 2,
"name": "Name 01"
},
{
"id": 3,
"name": "Name 01"
}
]
function renderItem(item:any, key:number) {
return <div>
<div>{item.name} </div>
</div>
}
<DataList
data={data}
renderItem={(item, key) => renderItem(item, key)}
pageSize={10}
/>Load data from Lucy asynchronously
A limited number of items of different types.
Sometimes we need to show different types of data. For this we can ues a Data Grid.
Last updated