Data getting and setting

This page introduces how to get and set various data.

Get Record Values

Syntax
pd.kumaneko.record.get(appID, container)
Parameters
Parameter Value Description
appID String The app ID.
container DOM
Single record screen:

DIV element at the bottom of the work area.

<div class="pd-kumaneko-app-body"></div>

In the case of the injector, it will be the following MAIN element.

<main class="pd-kumaneko-injector-body"></main>
List view screen:

DIV element in the row.

<div class="pd-scope"></div>
Response

The record object.

A record object is an object that contains record information such as field codes and field values.

References:

Field types

Sample
((APP_ID) => {
	"use strict";
	const handler = (event) => {
		console.log(pd.kumaneko.record.get(APP_ID, event.container));
	};
	pd.event.on(APP_ID, 'pd.edit.load.complete', handler);
})(pd.APP_ID);

Set Record Values

Syntax
pd.kumaneko.record.set(appID, container, record)
Parameters
Parameter Value Description
appID String The app ID.
container DOM
Single record screen:

DIV element at the bottom of the work area.

<div class="pd-kumaneko-app-body"></div>

In the case of the injector, it will be the following MAIN element.

<main class="pd-kumaneko-injector-body"></main>
List view screen:

DIV element in the row.

<div class="pd-scope"></div>
record Object

The record object.

A record object is an object that contains record information such as field codes and field values.

References:

Field types

Response
None
Sample
((APP_ID) => {
	"use strict";
	const handler = (event) => {
		const record = pd.kumaneko.record.get(APP_ID, event.container);
		if (record.field_1_.value)
		{
			record.field_1_.value='';
			pd.kumaneko.record.set(APP_ID, event.container, record);
		}
	};
	pd.event.on(APP_ID, 'pd.edit.load.complete', handler);
})(pd.APP_ID);

Get Record List Query

Syntax
pd.kumaneko.view.query(appID, viewID)
Parameters
Parameter Value Description
appID String The app ID.
viewID String The view ID.
Response
String
Sample
((APP_ID) => {
	"use strict";
	const handler = (event) => {
		console.log(pd.kumaneko.view.query(APP_ID, event.viewid));
	};
	pd.event.on(APP_ID, 'pd.view.load', handler);
})(pd.APP_ID);

Get Record List Sort Order

Syntax
pd.kumaneko.view.order(appID, viewID)
Parameters
Parameter Value Description
appID String The app ID.
viewID String The view ID.
Response
String
Sample
((APP_ID) => {
	"use strict";
	const handler = (event) => {
		console.log(pd.kumaneko.view.order(APP_ID, event.viewid));
	};
	pd.event.on(APP_ID, 'pd.view.load', handler);
})(pd.APP_ID);

Get field settings

Syntax
pd.kumaneko.app.fields(appID)
Parameters
Parameter Value Description
appID String The app ID.
Response

An object with data of the field settings.

References:

Get kumaneko settings

Sample
((APP_ID) => {
	"use strict";
	const handler = (event) => {
		console.log(pd.kumaneko.app.fields(APP_ID));
	};
	pd.event.on(APP_ID, 'pd.edit.load.complete', handler);
})(pd.APP_ID);

Get Logged-in User

Syntax
pd.kumaneko.users.login()
Response

The record object.

A record object is an object that contains record information such as field codes and field values.

References:

Field types

Sample
((APP_ID) => {
	"use strict";
	const handler = (event) => {
		console.log(pd.kumaneko.users.login());
	};
	pd.event.on(APP_ID, 'pd.edit.load.complete', handler);
})(pd.APP_ID);

Login user information cannot be obtained by the injector.