Create JavaScript file and upload to kumaneko

First of all, there are some points to keep in mind when creating a JavaScript file.

Make sure to create the file according to the following contents.

Character Encoding
Always use UTF-8 without BOM.
Using an IIFE

Immediately-Invoked Function Expression (IIFE) are an effective way to alias global variables, and to privatize variables and functions.

(() => {
	"use strict";
	pd.event.on('0','pd.dashboard.build',(event) => {
		event.space.css({height:'50px'});
		return event;
	});
})();

In JavaScript uploaded from the "customize" tab of each app, the app ID is output in the variable "pd.APP_ID", so describe that variable in the first argument when registering / deleting the event handler.

((APP_ID) => {
	"use strict";
	pd.event.on(APP_ID,'pd.edit.load',(event) => {
		if (event.record.field_1_.value) event.record.field_1_.value='';
		return event;
	});
})(pd.APP_ID);
Strict mode
Using the JavaScript's strict mode will prevent miscoding and will make your code more secure.

Create JavaScript file

In order to give you a real sense of what customization is, we will create a program that displays only simple messages.

  1. Display a message immediately after login

    Copy the following source code to a text editor and upload the saved file from the project setting screen.

    (() => {
    	"use strict";
    	pd.event.on('0','pd.dashboard.build',(event) => {
    		pd.alert('Hello kumaneko!');
    		return event;
    	});
    })();

    Save with an extension of ".js".

    See below for JavaScript import to customize the overall behavior of kumaneko.

    References:

    Initial Configuration

  2. Display the value of the text field when the record edit screen is displayed

    First, place and save the text field from the "form" tab of the newly added app.

    Next, open the record addition screen of the added app, enter any character in the text field, and save it.

    Copy the following source code to a text editor, replace the part described as "***" with the field ID of the text field you placed earlier, save the file, and then upload it from the "customize" tab of the app.

    ((APP_ID) => {
    	"use strict";
    	pd.event.on(APP_ID,'pd.edit.load',(event) => {
    		pd.alert(event.record.***.value);
    		return event;
    	});
    })(pd.APP_ID);

    Save with an extension of ".js".

    See below for importing into your app.

    References:

    Customize kumaneko

See below for how to display the events and messages described in the sample code.

References:

Event Handling

Dialog Boxes