Skip to content

Developer Function: Script

Overview

To enable UI operations that cannot be achieved with standard functions via Ajax POST requests, you can set JavaScript that can be applied to each site.
Below is how to add it and a list of currently available APIs.

How To Add A Script

(This operation requires "Site Administration Permission.")
1. Open the target table.
1. Click "Manage Table" from the "Manage" menu.
1. Open the "Script" tab.
1. Click the "Create New" button.
1. Enter/set the column in the table below.
1. Click the "Add" button.
1. Click the "Update" button at the bottom of the screen.

Column name Description Setting method
Title Script title Enter any title
Script Script content Enter any script
Output destination Select the output screen Set with checkboxes

List Of Script Functions

Site information acquisition script (SiteInfo.js)

No Function name Description
1 $p.tableName Function to get table type.
2 $p.controller Function to get controller type.
3 $p.action Function to get action type.

Site Information Update Script (_Data.js)

No Function name Description
1 $p.set This function changes the value on the screen and stores it in $p.data at the same time.

Site Message Script (Message.js)

No Function name Description
1 $p.clearMessage This function deletes the message displayed at the bottom of the screen.
2 $p.setMessage This function displays a message at the bottom of the screen.

Scripts for command operations and user/department/group operations (_Api.js)

No Function name Description
1 $p.apiUrl A function that retrieves the URL value of the API request.
2 $p.apiGet A function that retrieves values.
3 $p.apiCreate A function that creates new records.
4 $p.apiUpdate A function that updates records.
5 $p.apiDelete A function that deletes sites and records.
6 $p.apiBulkDelete A function that deletes sites and records in bulk.
7 $p.apiUsesGet A function to retrieve user information.
8 $p.apiUsesUpdate A function to update user information.
9 $p.apiUsesDelete A function to delete user information.
10 $p.apiDeptsUrl A function to retrieve the URL for executing the API for any department on the site.
11 $p.apiDeptsGet A function to retrieve department information.
12 $p.apiGroupsUrl A function to retrieve the URL for executing the API for any group on the site.
13 $p.apiGroupsGet A function to retrieve group information.
14 $p.apiSendMailUrl This function allows you to obtain the URL for sending emails via API.
15 $p.apiSendMail This function sends emails.

Value Setting/Update/Get/Delete Scripts (_Elements.js)

No Function name Description
1 $p.id A function to get the ID value of a record.
2 $p.siteId A function to get the ID value of a site.
3 $p.loginId A function to get the login ID.
4 $p.userId A function to get the user ID of the logged-in user.
5 $p.userName A function to get the name of the logged-in user.
6 $p.getColumnName A function to get the column name (database column name) of the target column.
7 $p.getControl A function to get elements from the target column name.
8 $p.getField A function to get the field from the target column name.
9 $p.getGridRow A function to get the tr tag element of the record on the "List Screen".
10 $p.getGridCell A function to get the td tag element on the "List Screen".
11 $p.getGridColumnIndex A function to get the column number of the record's name displayed data on the "List Screen".
12 $p.on A function that can execute any process when each event occurs.

Event Firing Script (_Event.js)

No Function name Timing Explanation
1 $p.events.on_editor_load When the edit screen is loaded This is a function that runs when the "Edit Screen" is loaded.
2 $p.events.on_grid_load When the list screen is loaded This is a function that runs when the "List Screen" is loaded.
3 $p.events.on_calendar_load When the calendar is loaded This is a function that runs when the "Calendar" is loaded.
4 $p.events.on_crosstab_load When a crosstab is loaded This function runs when a "Crosstab" is loaded.
5 $p.events.on_gantt_load When a Gantt chart is loaded This function runs when a "Gantt Chart" is loaded.
6 $p.events.on_burndown_load When a burndown chart is loaded This function runs when a "Burndown Chart" is loaded.
7 $p.events.on_timeseries_load When a timeseries chart is loaded This function runs when a "Timeseries Chart" is loaded.
8 $p.events.on_analy_load When an analysis chart is loaded This function runs when an "Analysis Chart" is loaded.
9 $p.events.on_kamban_load When a Kanban is loaded This function runs when a "Kanban" is loaded.
10 $p.events.before_validate Before validating input values This function runs before a validation check is performed.
11 $p.events.after_validate After validating input values This function runs after a validation check is performed.
12 $p.events.before_send Before sending data A function to run before sending data to the server.
13 $p.events.after_send After sending data A function to run after sending data to the server.
14 $p.events.before_set Before updating the screen A function to run after sending data to the server and before updating the screen contents.
15 $p.events.after_set After updating the screen A function to run after sending data to the server and updating the screen contents.