Add widgets
Overview
Widgets can be customized in many ways to reflect the styling and functionality you require. Use the widget image, location, chart, and other elements for customizations. In this section, you will learn how to change your map jig with an icon to a widget.location, and add a widget.image widget to the composite.jigx file.
Steps
Add a widget to a jig
Open the Hello-Jigx solution in Jigx Builder in VS Code, and click on the map.jigx file.
Delete the
icon: locationentry.Add the
widget.locationcode below. For the address you use expressions to call the city New York from the static datasource.
# The system name that uniquely identifies the jig
title: Location with address
# The jig type used to display data
type: jig.default
isCollapsible: true
# The type of datasource used to return data in the jig
datasources:
address:
# The static dataset is created directly inside the jig file
type: datasource.static
options:
data:
- street: 768 5th Ave
city: New York
country: US
# The control used by the jig
children:
- type: component.location
options:
viewPoint:
address: [email protected] & ',' & @ctx.datasources.address.city & ',' & @ctx.datasources.address.country
zoomLevel: 9
# The widget that displays on the home hub.
widgets:
map-location:
type: widget.location
options:
viewPoint:
address: [email protected] 4. Open the composite.jigx file and copy the code below. Note the new widgets section using widget.image showing a source uri for the image you want displayed.
5. Save and publish the Hello-Jigx solution. 6. Run the Hello-Jigx solution on your mobile device to see the change to the map widget on the Home Hub.
Last updated
Was this helpful?