website logo
👥 Community🎯 Samples on GitHub🚦System Status
💡 Guides
🚀 Examples
🍕 Developer Reference
⚡️ Changelog
🎥 Video Library
Navigate through spaces
⌘K
Examples Overview
Setting up your solution
Jig Types
Components
Datasource
Actions
Preview
Widgets
Expressions
Aggregation
Boolean
Comparison Operators
Date & Time
Path Operators
Functional Programming
Jigx Variables
Predicate Queries
String
Docs powered by
Archbee
Actions

action-list

6min

This action allows for multiple actions to be run while only requiring the user to press a single button. The actions can be set to run sequentially or executed as a bulk functionality.

Configuration options

An action list can be set up in various ways:

  1. As a primary action button
  2. In onPress/onChange events - usually triggered by list or jig.list related items
  3. In onRefresh/onFocus events on any type of Jig

Examples and code snippets 

Action-list as a primary action button

Action List
Action List




This example shows an action-list with two actions. The first action is submit-form, which will save the entered data, and the second action, go-back, will redirect us back to the previous page.

Example: See the full example of action-list in GitHub.

action-list
|
actions:
  - children:
      - type: action.action-list
        options:
          isSequential: true
          title: Submit form
          actions:
            - type: action.submit-form
              options:
                formId: simple-form
                provider: DATA_PROVIDER_DYNAMIC
                entity: default/employees
                method: save
            - type: action.go-back


Action list as onPress/onChange

Document image


In this example, we have an action list with the onPress function in the list-item. The first action will color the last chosen item and the second action will sync our entity with the database and we can use them for further actions.

Example: See the full example of action-list in onPress in GitHub. See the full example of action-list in onChange in GitHub.

action-list-onPress
action-list-onChange
|
item: 
  type: component.list-item
  options:
    title: =@ctx.current.item.firstname
    subtitle: =@ctx.current.item.email
    progress: =@ctx.current.item.id = @ctx.solution.state.activeItemId ? 1 :0
    color:
      - when: =@ctx.current.item.id = @ctx.solution.state.activeItemId ? true :false
        color: color2
    rightElement: 
      element: switch
      onChange: 
        type: action.action-list
        options:
          actions:
            - type: action.set-state
              options:
                state: =@ctx.solution.state.activeItemId
                value: =@ctx.current.item.id
            - type: action.sync-entities
              options:
                provider: DATA_PROVIDER_DYNAMIC
                entities:
                  - default/employees


Action list as onRefresh/onFocus

In this example when we refresh the jig/jig is focused, we call set-state and sync-entities actions.

Example: See the full example of the action list onRefresh in GitHub. See the full example of the action list onFocus in GitHub. 

action-list-onRefresh
action-list-onFocus
|
onFocus: 
  type: action.action-list
  options:
    isSequential: true
    actions:
      - type: action.set-state
        options:
          state: =@ctx.solution.state.focus-key
          value: focused
      - type: action.sync-entities
        options:
          provider: DATA_PROVIDER_DYNAMIC
          entities:
            - default/employees


See also

  • Developer reference



Updated 19 Sep 2023
Did this page help you?
PREVIOUS
system
NEXT
confirm
Docs powered by
Archbee
TABLE OF CONTENTS
Configuration options
Examples and code snippets
Action-list as a primary action button
Action list as onPress/onChange
Action list as onRefresh/onFocus
See also
Docs powered by
Archbee
Copyright © 2023 Jigx, Inc. All rights reserved. Terms of Service