Skip to main content

General Events

ErrorOccured

Description

The ErrorOccured event is triggered when an error occurs on a Dashboard or Record Level Maptaskr Map. This event provides information about the error message and error details.

Usage

To listen for the ErrorOccured event, you can use the on method of the window.top['maptaskrCORE'] object. This allows you to register an event listener that executes a call-back function when the event is triggered.

Example

window.top['maptaskrCORE'][controlId].on("ErrorOccured", function(errMessage, errDetails) {
console.log("errMessage: " + errMessage);
console.log("errDetails: " + errDetails);
});

In the example above, we've registered an event listener for the ErrorOccured event. When the event occurs, the provided call-back function is executed, logging the error message and error details to the console.

Parameters

  • errMessage (string): The error message.
  • errDetails (object): Additional details about the error (may be undefined).

Removing Event Listeners

To remove the event listener for the ErrorOccured event, you can use the off method of the window.top['maptaskrCORE'] object. This is useful when you no longer want to listen to this specific event.

Example

window.top['maptaskrCORE'][controlId].off("ErrorOccured");

In the example above, the event listener for ErrorOccured is removed, ensuring that the associated call-back function no longer executes when the event is triggered.

WarningOccured

Description

The WarningOccured event is triggered when a warning message is generated on a Dashboard or Record Level Maptaskr Map. This event provides information about the warning message and warning details.

Usage

To listen for the WarningOccured event, you can use the on method of the window.top['maptaskrCORE'] object. This allows you to register an event listener that executes a call-back function when the event is triggered.

Example

window.top['maptaskrCORE'][controlId].on("WarningOccured", function(warningMessage, warningDetails) {
console.log("warningMessage: " + warningMessage);
console.log("warningDetails: " + warningDetails);
});

In the example above, we've registered an event listener for the WarningOccured event. The provided call-back function is executed when the event occurs, logging the warning message and warning details to the console.

Parameters

  • warningMessage (string): The warning message.
  • warningDetails (object): Additional details about the warning (may be undefined).

Removing Event Listeners

To remove the event listener for the WarningOccured event, you can use the off method of the window.top['maptaskrCORE'] object. This is useful when you no longer want to listen to this specific event.

Example

window.top['maptaskrCORE'][controlId].off("WarningOccured");

In the example above, the event listener for WarningOccured is removed, ensuring that the associated call-back function no longer executes when the event is triggered.

SavingCompleted

Description

The SavingCompleted event is triggered when Maptaskr completes saving data on a Record Level Maptaskr Map ONLY.

Usage

To listen for the SavingCompleted event, you can use the on method of the window.top['maptaskrCORE'] object. This allows you to register an event listener that executes a call-back function when the event is triggered.

Example

window.top['maptaskrCORE'][controlId].on("SavingCompleted", function() {
console.log("Maptaskr has finished saving shapes");
});

In the example above, we've registered an event listener for the SavingCompleted event. The provided call-back function is executed when the event occurs, logging the notification to the console.

Parameters

This event does not have any parameters.

Removing Event Listeners

To remove the event listener for the SavingCompleted event, you can use the off method of the window.top['maptaskrCORE'] object. This is useful when you no longer want to listen to this specific event.

Example

window.top['maptaskrCORE'][controlId].off("SavingCompleted");

In the example above, the event listener for SavingCompleted is removed, ensuring that the associated call-back function no longer executes when the event is triggered.