jig.document
The document jig type is used to display documents connected to your solution. The display of the document is provided in the following formats:
PDF file
HTML page - set up using:
A URL (website link)
HTML

Configuration options
Some properties are common to all jig types, see Common jig type properties for a list and their configuration options.
title
Provide the name of the screen. If you do not want to show a title in a jig use title: ' ' or add an expression.
source
Select from PDF or HTML content.
description
The general description of the document.
badge
Enhance your widget with customizable badges, for instance, show the number of documents. Add the badge property to the jig YAML with an expression.
icon
The icon will be displayed on the widget of this jig. Start typing the name of the icon to invoke the available list in IntelliSense. See Jigx icons for information on working with icons.
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.
Examples and code snippets
The code below is an extract from the full jigx-samples solution. The code snippets describe the component discussed in this section. For the solution to function in the Jigx app download the full jigx-samples project from :Link[GitHub]{href="https://github.com/jigx-com/jigx-samples/tree/main/quickstart/jigx-samples" newTab="true" hasDisabledNofollow="false"}, and follow the instructions in Setting up your solution.
PDF Document Example

type: jig.document
title: PDF Document Type (Dynamic Data)
description: Example of PDF Financial Report
icon: document
badge: 1
placeholders:
- when: [email protected]
title: No data to display
source:
documentType: PDF
uri: [email protected][type='PDF'].urldatasources:
documents-dynamic:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_DYNAMIC
entities:
- entity: default/documents
query: |
SELECT
id,
'$.name',
'$.description',
'$.type',
'$.url'
FROM [default/documents] HTML Document Example (URL)

HTML Document Example (Content)
You can also use this jig type to pass raw HTML into the webview (without linked CSS, JS etc.).

In this example a jig.document is used to display raw HTML content.
Examples: See the full code sample in GitHub.
HTML Document Example (Content with Message Listener)

In this example a jig.document is used to display raw HTML content. A message listener was added via JavaScript called linkTapped(). The HMTL can pass a value into the message listener and the message then gets passed on as JSON to the Jigx App . The JSON object is then available in the state expression using @ctx.jig.state.data. All properties of your object can be accessed using @ctx.jig.state.data.[yourproperty].
When the jig gets focus, the state is reset in this example.
See Also
Last updated
Was this helpful?