Metric
- The Metric Section can be used to display statistics. It has a title and a data space with a maximum of 3 entities.
- Navigation can be set for all the elements in the section, by specifying navigate: true in the section level or add the attribute in the element in the section.
- The reference_id can be set for all navigable elements, which will be passed to the action handler to know which element was accessed to navigate.
Parameter | Description | Datatype | Max Limit |
name | Unique ID for the section | String | 50 |
layout | Type of section layout - Metric | String | |
title | Unique title for the section | String | 30 |
navigate | Navigation status for elements in the section | Boolean | |
data | Data to be included in the section | List | 3 |
link | URL associated with | ||
link_hint | Text that is displayed on hovering over the link | String | |
actions | Actions that have to be performed | List | 2 |
reference_id | Additional values that need to be passed to the action handler. This will be available in the target parameter of the action handler as section_reference_id | String | 300 |
Data element structure:
Parameter | Description | Datatype | Max Limit |
label | Unique label for data items | String | 50 |
value | Value of the item | String | 10 |
name | Unique name for each element Note: Element name is mandatory if reference_id is available in that element or navigate is true for that element or section | String | 50 |
reference_id | Additional values that need to be passed to the action handler. This will be available in the target parameter of the action handler as element_reference_id | String | 300 |
Action structure:
Parameter | Description | Datatype | Max Limit |
label | Label to be shown for the button | String | 30 |
name | Unique name for each action element | String | 50 |
reference_id | Additional values that need to be passed to the action handler. This will be available in the target parameter of the action handler as action_reference_id | String | 300 |
Note:
If the datatype is String then the Max Limit indicates the character limit and if the datatype is List, then it indicates the maximum number of values that can be included in the list
Sample Code:
Copiedmetrix = {{"label":"Points","value":"382"},{"label":"Membership","value":"-"},{"label":"Expires","value":"-"}};
metricSection = {
"name":"levelSection",
"layout":"metric",
"title":"Customer Level",
"navigate" : false,
"data":metrix,"actions":{
{
"label":"Upgrade / Downgrade",
"name":"changeLevel"
},
{
"label":"Cancel",
"name":"cancel"
}
}
"link" : "https://www.zylker.com/customer",
"link_hint" : "Click here to view customer details"
"reference_id" : "1"
};