User Manual

06.20.2025

MANUAL

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

## Answer This can be achieved in one of the following ways. 1. Add the process you want to execute to an array, and call the processes stored in the array in sequence with $p.events.on_editor_load. 1. Define the process you want to execute as a single function, and call the function in sequence with $p.events.on_editor_load. --- ## Overview If you write $p.events.on_editor_load multiple times across multiple script files, the scripts will be overwritten and only the most recent one will work. There are two ways to work around this: 1. Add the process you want to execute to an array, and call the processes stored in the array in sequence with $p.events.on_editor_load. 1. Define the process you want to execute as a single function, and call the function in sequence with $p.events.on_editor_load. In addition to $p.events.on_editor_load, the same problem occurs with $p.events.on_grid_load and other "「Event Firing Script」," and can be avoided with this content. ### 1. Add the process you want to execute to an array, and call the processes stored in the array in sequence with $p.events.on_editor_load ## Sample Code ##### JavaScript ``` //Define an array $p.events.on_editor_load_arr = []; ``` ##### JavaScript ``` //Add process 1 $p.events.on_editor_load_arr.push(function() { alert("test1"); //Any process }); ``` ##### JavaScript ``` //Add process 2 $p.events.on_editor_load_arr.push(function() { alert("test2"); //Any process }); ``` ##### JavaScript ``` //Execution $p.events.on_editor_load = function() { for (let i = 0; i < $p.events.on_editor_load_arr.length; i++) { $p.events.on_editor_load_arr[i] (); } } ``` Register the following in Pleasanter's "「Script」". ![image](https://pleasanter.org/binaries/c7fe20982d654aada7ad6ee8c48d974d) Register the "Define an array" script at ID=1, and the "Execution" script at ID=4. Register the scripts to add the processes you want to execute at ID=2 and ID=3. In this example, two processes are added, but you can add any number of processes by writing them between ID=1 and ID=4. ### 2. Define the process you want to execute as one function, and call the functions sequentially with $p.events.on_editor_load ## Sample ##### JavaScript ``` //Define process 1 $p.ex.myFunc1 = function() { alert("test1"); //Any process } ``` ##### JavaScript ``` //Define process 2 $p.ex.myFunc2 = function() { alert("test2"); //Any process } ``` ##### JavaScript ``` //Execute $p.events.on_editor_load = function() { $p.ex.myFunc1(); $p.ex.myFunc2(); } ``` Register the following in the "「Script」" of Pleasanter. ![image](https://pleasanter.org/binaries/384ef27e45fd449896e08cc5ab158c1f) Register the script for the function defined with ID=1,2. Register the "Execution" script with ID=3. In this example, two processes are added, but you can add as many processes as you want by listing them before ID=3.
support_agent 本格運用を、もっと安心・安全に

安定運用や活用拡大を見据えるなら、年間サポートサービスをご活用ください。

年間サポートサービスの詳細はこちら →
rocket_launch 導入・移行の不安を、まるごと支援

環境構築から移行・更新まで、導入をしっかりサポートします。

システム導入支援サービスの詳細はこちら →
TOP