Skip to main content

Datasource

Datasource is a set of attributes common to the components that accept a list of items or options (radio, tabs, list, table, select). In the context of a datasource {{$item}} represents each of the items.

Common Attributes

AttributeTypeDescription
extraSettings.dataSourcestringAccepted values are:
Static: $items are provided in extraSettings.items
REST: $items will be provided by a REST request response
extraSettings.formatItemstringExpression, representation of the $item, e.g. {{$item.name}}
extraSettings.identitystringAttribute of $item that identifies it, e.g. globalId
extraSettings.storagestringAccepted values are:
Full: the whole $item will be saved to the payload
Id: only the result of extraSettings.identity will be saved

Static Datasource Attributes

AttributeTypeDescription
extraSettings.itemsObject[]List of items. See Static example

Static example

Loading...

Rest Datasource Attributes

AttributeTypeDescription
extraSettings.queryUrlstringURL to request the items with optional variables.
$searchText: Text the user typed if the component allows search.
$start: First item index (for pagination).
$pageSize: Number of items per page.
eg. /rest/users?start={{$start}}&size={{$pageSize}}
extraSettings.lookupUrlstringURL to get the full $item from the $id, eg. /rest/users/{{$id}}
extraSettings.pathstringWhere to find the array of items in the response, eg. data.users
extraSettings.pageSizenumberDesired number of items per page
extraSettings.response.nextstringWhere to find the next page url in the response, eg. nextPage
extraSettings.response.previousstringWhere to find the previous page url in the response, e.g. previousPage
extraSettings.response.startstringWhere to find the first item index in the response, e.g. start
extraSettings.response.totalstringWhere to find the total number of items in the response, e.g. total

REST example

Loading...

When to use it

Currently, radio, checkbox group, tabs, list, table and select components use datasource. Please note that not all of them support searching or pagination.