- 1. Description
- Templates
- How to use it
- 1. Creation of the object
- 2. Creation of the Template
- 3. Reload and Launch
- Use Cases
1. Description
Card views are created in Build.one using the SwatDataView object. The card view control looks like an explorer view displaying multiple records as tiles:
Templates
The design of the cards can be changed by creating new templates. This templates are created in Vue and the composition of the data, the styles and the behaviour are customisable. With Build.One a set of generic templates is provided, so you don’t need to create a new one if one of this satisfies your needs. The available templates are the next ones.
- card-small
- card-background-small
- card-big
- card-background-big
- card-square
How to use it
1. Creation of the object
- Create a screen with a panel.
- Add the following objects:
- Correspoding DSO
- SimpleSwatDataview
- Link the objects in the following order:
- ThisObject to DSO(Type PrimarySDO)
- DSO to Dataview (Type Data)
- Select the SimpleSwatDataview and change the following attributes:
TemplateFormat
→vue
Template
→yourtemplatename
Name (without file extension .vue) of the Vue template in Gitpod (see step 6 to create a template)TemplateOptions
→'fad fa-3x fa-cube'|fieldname1|Fieldname2
where fieldname1 and fieldname2 can be every field related to your DSO. Within the vue-template you have access to- fieldname1 via
key
- fieldname2 via
decs
- but you can also access every DSO-related field via
currentRecord.fieldname
(fieldname must be specified in lowercase)
You can use one of the existing templates that are described before here
2. Creation of the Template
This step is not needed if you use one of the existing templates
- Create a new Vue template in
src/webui/templates
with the extension .vue - Declare the Vue template in index.ts in the following view:
‣
export const yourtemplatename = () => import(/* webpackChunkNAme: "yourtemplatename" */'./yourtemplatename.vue');
3. Reload and Launch
- Perform a hard reload and empty the cache and check the result.
Use Cases
Back to Documentation
Back to Home Page