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.

ParameterDescriptionDatatypeMax Limit
nameUnique ID for the sectionString50
layoutType of section layout - MetricString 
titleUnique title for the sectionString30
navigateNavigation status for elements in the sectionBoolean 
dataData to be included in the sectionList3
linkURL associated with   
link_hintText that is displayed on hovering over the linkString 
actionsActions that have to be performedList2
reference_idAdditional 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_idString300

Data element structure:

ParameterDescriptionDatatypeMax Limit
labelUnique label for data itemsString50
valueValue of the itemString10
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

String50
reference_idAdditional 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_idString300

Action structure:

ParameterDescriptionDatatypeMax Limit
label Label to be shown for the buttonString30
name

Unique name for each action element

String50
reference_idAdditional 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_idString300

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"

};