All actions taken for clicking a button, submitting a form, and other such events support optional javascript callback settings.
confirmAction
Set a tracking name and javascript callback for a "confirm" button click event.
confirmAction object |
Key |
Type |
Behavior |
name |
string |
optional name of the confirm event to send to Lytics and Google Analytics |
close |
boolean |
optional if false, prevent the modal from closing after the callback is executed |
callback |
function |
optional function to execute when the use clicks the "confirm" button (see params below) |
waitForAsyncResponse |
boolean |
optional if true, a third parameter (cb) will be passed to the callback function (see params below) |
callback function |
Parameter |
Type |
Behavior |
event |
string |
name of the event |
payload |
object |
object containing the rendered DOM Element (widget), the config of the widget (config), the javascript event (event), and the data submitted by the user in the case of modules with a form (data) |
cb |
function |
optional cb accepts a single boolean param, if true, the submission was counted as successful, and the success state will show. if false, the error state will show. |
cancelAction
Set a tracking name and javascript callback for a "cancel" button click event.
cancelAction object |
Key |
Type |
Behavior |
name |
string |
optional name of the cancel event to send to Lytics and Google Analytics |
close |
boolean |
optional if false, prevent the modal from closing after the callback is executed |
callback |
function |
optional function to execute when the use clicks the "cancel" button (see params below) |
callback function |
Parameter |
Type |
Behavior |
event |
string |
name of the event |
payload |
object |
object containing the rendered DOM Element (widget), the config of the widget (config), and the javascript event (event) |
closeAction
Set a tracking name and javascript callback for a "close" button click event.
cancelAction object |
Key |
Type |
Behavior |
name |
string |
optional name of the cancel event to send to Lytics and Google Analytics |
callback |
function |
optional function to execute when the use clicks the "close" button (see params below) |
callback function |
Parameter |
Type |
Behavior |
event |
string |
name of the event |
payload |
object |
object containing the rendered DOM Element (widget), the config of the widget (config), and the javascript event (event) |
onInit
Javascript callback function on initialization of the module. This should trigger just before the module is shown.
onInit function |
Parameter |
Type |
Behavior |
event |
string |
name of the event |
payload |
object |
object containing the pathfora module (config) |
onLoad
Javascript callback function on loading the module, triggered when the module is shown to the user.
onLoad function |
Parameter |
Type |
Behavior |
event |
string |
name of the event |
payload |
object |
object containing the Pathfora module (config) and the rendered DOM Element (widget) |
onClick
Javascript callback function for button layouts only on click of the button widget.
onClick function |
Parameter |
Type |
Behavior |
event |
string |
name of the event |
payload |
object |
object containing the rendered DOM Element (widget), the pathfora module (config), and the javascript MouseEvent (event) |
onSubmit (deprecated)
This callback is deprecated. We advise using confirmAction instead, as it has the same functionality.
Javascript callback function for any types with form elements on submission of the form (includes form data as param).
onSubmit function |
Parameter |
Type |
Behavior |
event |
string |
name of the event |
payload |
object |
object containing the rendered DOM Element (widget), the pathfora module (config), and the javascript Event (event), and the data submitted by the user (data) |
onModalClose
Javascript callback function for when a module is closed, this will fire anytime the modal is closed, regardless if the user clicks the confirm, close, or cancel button.
onModalClose function |
Parameter |
Type |
Behavior |
event |
string |
name of the event |
payload |
object |
object containing the rendered DOM Element (widget), the pathfora module (config), and the javascript Event (event), and the data submitted by the user (data) |