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
Attribute | Type | Description |
---|---|---|
extraSettings.dataSource | string | Accepted values are:Static : $items are provided in extraSettings.itemsREST : $items will be provided by a REST request response |
extraSettings.formatItem | string | Expression, representation of the $item, e.g. {{$item.name}} |
extraSettings.identity | string | Attribute of $item that identifies it, e.g. globalId |
extraSettings.storage | string | Accepted values are:Full : the whole $item will be saved to the payloadId : only the result of extraSettings.identity will be saved |
Static Datasource Attributes
Attribute | Type | Description |
---|---|---|
extraSettings.items | Object[] | List of items. See Static example |
Static example
Loading...
Rest Datasource Attributes
Attribute | Type | Description |
---|---|---|
extraSettings.queryUrl | string | URL 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.lookupUrl | string | URL to get the full $item from the $id, eg. /rest/users/{{$id}} |
extraSettings.path | string | Where to find the array of items in the response, eg. data.users |
extraSettings.pageSize | number | Desired number of items per page |
extraSettings.response.next | string | Where to find the next page url in the response, eg. nextPage |
extraSettings.response.previous | string | Where to find the previous page url in the response, e.g. previousPage |
extraSettings.response.start | string | Where to find the first item index in the response, e.g. start |
extraSettings.response.total | string | Where 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.