障害・更新情報 English Chinese

kintone plugin series

フィールド値変更イベント

このページでは、フィールド値の変更とテーブル行の追加や削除に関するイベントを紹介します。


フィールド値の変更イベント

対象プラグイン
イベントタイプ
bst.change.[フィールドコード]
eventオブジェクトのプロパティ
プロパティ名 説明
type 文字列 イベントタイプ
container DOM
テーブル外フィールド:

DIV要素

テーブル内フィールド:

フィールドが属するテーブル行

<div class="bst-scope"></div>
インジェクターのテーブル外フィールド:

MAIN要素

<main class="bst-scope"></main>
record オブジェクト

レコードオブジェクト

サンプル
(() => {
	"use strict";
	bst.event.on('bst.change.field_1_', (event) => {
		console.log(event);
		return event;
	});
})();

テーブル行の追加前イベント

対象プラグイン
イベントタイプ
bst.row.add.[tableフィールドのフィールドコード]
eventオブジェクトのプロパティ
プロパティ名 説明
type 文字列 イベントタイプ
container DOM

テーブル要素

<table class="bst-table"></table>
record オブジェクト

レコードオブジェクト

rowindex 数値 追加予定の行インデックス
サンプル
(() => {
	"use strict";
	bst.event.on('bst.row.add.field_9_', (event) => {
		console.log(event);
		return event;
	});
})();

eventオブジェクトのerrorプロパティをtrueにして返すことにより、追加がキャンセルされます。

テーブル行の複製前イベント

対象プラグイン
イベントタイプ
bst.row.copy.[tableフィールドのフィールドコード]
eventオブジェクトのプロパティ
プロパティ名 説明
type 文字列 イベントタイプ
container DOM

テーブル要素

<table class="bst-table"></table>
record オブジェクト

レコードオブジェクト

rowindex 数値 追加予定の行インデックス
サンプル
(() => {
	"use strict";
	bst.event.on('bst.row.copy.field_9_', (event) => {
		console.log(event);
		return event;
	});
})();

eventオブジェクトのerrorプロパティをtrueにして返すことにより、複製がキャンセルされます。

テーブル行の削除前イベント

対象プラグイン
イベントタイプ
bst.row.del.[tableフィールドのフィールドコード]
eventオブジェクトのプロパティ
プロパティ名 説明
type 文字列 イベントタイプ
container DOM

テーブル要素

<table class="bst-table"></table>
record オブジェクト

レコードオブジェクト

rowindex 数値 削除前の行インデックス
サンプル
(() => {
	"use strict";
	bst.event.on('bst.row.del.field_9_', (event) => {
		console.log(event);
		return event;
	});
})();

eventオブジェクトのerrorプロパティをtrueにして返すことにより、削除がキャンセルされます。