jig.grid

The jig.grid enables you to create grid layouts in your app, organizing content into rows and columns for a visually consistent and flexible interface. It helps align elements proportionally, ensuring a structured design. The grid is ideal for creating galleries to display photos or product images, as well as dashboards, menus, and product lists.

Custom Grid
Custom Grid
Auto Grid
Auto Grid

Configuration options

The jig.grid has two available configuration options:

  1. Auto Grid - used to create a grid layout from a datasource. This is similar in configuration to a jig.list where a single grid-item is configured and iterates through the datasource.

  2. Custom Grid - used to create a custom grid layout using widgets, images, or custom components in various sizes. Some properties are common to all jig types, see Common jig type properties for a list and their configuration options.

Core structure

title

Give the jig a title that is displayed at the top of the screen. If you do not want to show a title in a jig use title: ' '.

type

Select jig.grid for a grid layout configuration.

component

Within a grid jig type, the component is used to define each of the elements in the grid layout. Within the grid-item a select set of components can be configured.

datasources

Configure a datasource to call the data to display in the grid layout. The datasource property is required for the Auto Grid, but is optional for the Custom Grid selection.

Other options

actions

Choose from the provided list of available actions, for example, use the go-to action to open a different jig.

badge

Enhance your tabs with a badge, for instance show the number of grid-items. Add the badge property to the jig YAML with an expression.

description

Give the jig a description that is displayed under the title.

data

Reference a global datasource to use in the jig.

expressions

Use the expressions property to set expressions that are reusable throughout the jig.

filter

The filter property creates tabbed filter options to categorize and filter data in the jig. For more information, see the filter in the common jig type properties.

grid-item

size - Select either 1x1, 2x2, 2x4, 4x2, 4x4 children - Select a component from the predefined list to display in the grid. The components for selection are:

isSearchable

Setting the isSearchable property to true adds a search field at the top of the screen. By default, screens display without search fields. For more information on configuration and requirements, see the isSearchable in the common jig type properties.

header

Configure a that displays and image, location or video at the top of the jig.

icon

The icon will be displayed on the jig widget. Start typing the name of the icon to invoke the available list in IntelliSense. See Jigx icons for information on working with icons. The icon property applies to component.jig-widget without a widgetId. See the considerations below for the rules governing icon behavior.

inputs

Configure that allow you to receive data from other jigs and use it in the current jig.

isCollapsible

When the jig is used in a composite jig, and this property is set to true, a collapse and expand icon is shown, allowing the jig to be collapsed. This is helpful if the composite jig has a number of jigs configured, making it easier to view and interact with the app.

isInitiallyCollapsed

When the property is set to true and the jig is part of a composite jig, the jig will open in collapsed mode when the composite jig is launched.

isWaitingSync

Displays a waiting sync indicator.

jigId

Give the jig a unique id that can be referenced outside the jig, for example in state expressions.

outputs

Configure that allow you to transfer data out of the current jig and use it in another jig.

placeholders

Create a placeholder to show when there is no data to use yet. See tips and tricks -use a placeholder for a placeholder example.

preview

Configure the preview that is triggered by long-pressing on the grid-item.

summary

Add a component that displays at the bottom of the jig.

title

By default, the jig's title is displayed on the widget. You can override it by adding the title property to the component.jig-widget in the grid-item, either with a custom title or with '' (a blank space) to remove the title entirely.

Events

onFocus

Configure an action that executes when the jig opens, for example, reset-solution-state.

onRefresh

Configure an action that executes when the jig is pulled down, for example, sync-entities.

onPress

Add an onPress event to add an action directly on the grid-item, such as open-url.

Considerations

  • When using the grid-item with a component.jig-widget, note the following:

    • A widgetId is required if the referenced jig includes a widget configuration. This value should match the Widget Name specified in the referenced jig.

    • If no widget configuration exists, the widget’s icon is inherited from the jig’s icon value. If no icon is specified there either, a default icon is used. You can override the icon by specifying one in the component.jig-widget of the grid-item.

  • For a 1x1 widget, or a component.widget with no widgetId, the following rules apply:

    • If no icon is specified, a default icon is displayed.

    • If an icon is configured in the linked jig, that icon is used.

    • If an icon is specified in the component.widget of the grid-item, it overrides all other icon settings.

  • A jig with inputs in it's title will display without a title (blank) as the jig would not have received those inputs.

Examples and code snippets

Custom grid jig

Custom Grid - Delivery
Custom Grid - Delivery

In this example, a delivery company uses a dashboard for drivers to display their daily deliveries, urgent tasks, inspection checklists, logs, and customer ratings or complaints. The jig.grid with the custom grid option is used, allowing multiple grid-item configurations. These items include widgets, images, and custom components in various sizes.

Examples: See the full code sample in GitHub. Supporting jig samples in GitHub.

Auto grid jig

Auto Grid -Image Gallery
Auto Grid -Image Gallery

In this example, a gallery of images is created to showcase the services a company offers. The jig.grid type is used with a datasource, enabling a simple configuration based on the records in the datasource. The component.grid-item only needs to be configured once using the expression [email protected]. followed by the desired data field. Using current loops through the datasource, creating a grid-item for each data record. Note that the specified size will apply to all returned records.

Examples: See the full code sample in GitHub

Custom grid jig with default widget icons and titles

Default icons
Default icons

In this example, no icons are configured, so all widgets display the default icon. The title of the jig is displayed below the widget.

Custom grid with jig icons

In this example, the widget icons are configured in each jig, and the jig title is displayed below the widget.

Jig icons
Jig icons

Custom grid jig with custom widget icons

Custom icons
Custom icons

In this example, the widget icons are configured in the component.widget of the grid-item, overriding the icons defined in the individual jigs. The jig title is displayed below each widget.

Custom grid jig with no widget and image titles

This example demonstrates that setting the title property in thecomponent.widget of the grid-item overrides the default jig title. Configuring the component.widget title as a blank space ( ' ' ) removes the title entirely. Custom icons are also configured in the component.widget of the grid jig for each widget.

Widgets with no titles
Widgets with no titles

Custom grid with custom widget and image titles

Custom titles
Custom titles

This example demonstrates that setting the title property in the component.widget grid-item overrides the default jig title. Custom icons are also configured in the component.widget of the grid jig for each widget. For image widgets, the title configured in the component.image of the grid-item overlays the image.

Examples: See the full code sample in GitHub. Supporting jig samples in GitHub.

Custom grid widgets with OnPress event

In this example, each component.widget is configured with an onPress event that executes an action, such as opening-a-map or displaying an info-modal. Note that the configured onPress event overrides the default behavior of opening the jig specified in the jigId.

Widget with onpress
Widget with onpress

Last updated

Was this helpful?