Skip to content

$p.events.before_set

Overview

This explains how to specify a method to be executed after sending data to the server and before updating the screen contents.

Limitations

  1. If you create multiple scripts and write this function in each of them, the scripts are overwritten, so only the latest one works. For a workaround, refer to the following FAQ.

How To Use

JavaScript

$p.events.before_set = function (args) {
    //Processing content
}
or
$p.events.before_set_{Value of the data-action attribute} = function (args) {
    //Processing content
}

*Get this if you want to explicitly write the value of the data-action attribute of the button that will cause the event.

Code Samples

Set the following sample code in the Pleasanter script, set the output destination to "Edit", and then press the "Update" button (in this example, the value of the data-action attribute, Update, is explicitly stated).

JavaScript
$p.events.before_set_Update = function () {
    $p.setMessage('#Message', JSON.stringify({
        Css: 'alert-success',
        Text: 'Before the screen update.'
        })
    );
}

FAQ: I want to be able to set multiple $p.events.on_editor_load