Module: ajax

Ajax action to execute an ajax request
Parameters:
Name Type Description
node object The configuration object for the ajax action
Properties
Name Type Default Description
type string 'action' The type of the node is action
actionType string 'ajax' The actionType of the node is ajax
text string The text to display on the button
options object The options pertaining to the ajax action
Properties
Name Type Description
target object The target object for the ajax request
Properties
Name Type Description
uri string The uri of the request to be made
name string The name of the request to be made
options object The options pertaining to the target
data object The data to send on the request
options.headers object Key-value pairs to set as headers on the request
options.type string The HTTP type of request to make (POST, PUT, etc)
sendDataFromKey string | Array The key or array of keys for where the data is stored
sendDataKeys Array Array of data keys to use, can be objects with key-value pairs
dataAndResults boolean Boolean value to determine whether to combine data with results from a previous ajax action
results object Object of results from a previous ajax action
params object Key-value pairs to set as parameters on the request
keyMap array | object A mapper object or array of mapper objects to map keys
Properties
Name Type Description
resultsKey string Map the results from the ajax call with this key
nextActions array An array of action objects to perform after the action is completed successfully
errorActions array An array of action objects to perform if the action ends with an error
Source:
Example
{
       "type": "action",
       "actionType": "ajax",
       "text": "SUBMIT",
       "options": {
           "target": {
               "uri": "add-endpoint",
               "options": {
                   "type": "POST"
               }
           },
           "nextActions": [
               {
                   "type": "action",
                   "actionType": "route",
                   "options": {
                       "target": "dashboard"
                   }
               }
           ]
       }
   }