Event Handling

Event Handling

Overview

On this page, we introduce how handlers can be attached to various kintone events. The different types of kintone events are listed in the side menu.

Register Event Handlerskintone.events.on(type, handler)

Registers an event handler.

Function

kintone.events.on(type, handler)

Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
type A string or an array of strings Yes The event type or array of event types, to which the event handler will bind to.
handler Function(Object) Yes The handler that will run when the event is triggered.
It accepts a single parameter, which is the Event object that contains information of the triggered event.
By returning a kintone.Promise object* in the event handler, the next operations can be processed after waiting for asynchronous processes in the event handler to finish:

-Record List Events:
Onload Event
Inline Edit Event
Save Submit Event
Save Submit Success Event
Delete Submit Event

-Record Details Events:
Onload event
Delete Submit Event
Proceed Process Event

-Record Create Events:
Onload Event
Save Submit Event
Save Submit Success Event

-Record Edit Events:
Save Submit Event
Save Submit Success Event
Onload Event

-Record Print Events:
Onload Event

-Graph Display Events:
Onload Event

-Portal Display Events:
Onload Event


*A kintone.Promise object is an object that holds a "then" method.
- Reference(External site)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

Response

None

Sample

Remove Event Handlers kintone.events.off(type, handler)

Removes event handlers from the specified event type(s).

Function

kintone.events.off(type, handler)

Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
type String or Array of Strings   The event type(s) to which the event handler is bound to.
handler Function(Object)   The handler that will be removed from the specified event type(s).
If no value is set for this parameter, all event handlers will be removed from the specified event type(s).
If no values are set for both the type and handler parameter, then all event handlers will be removed from all event types.

Response

True, if any event handlers were removed.
False, if no event handlers were removed.

Sample

Limitations

Was this article helpful?
0 out of 0 found this helpful
Do you have any questions or issues related to this article?
Please share your views with us in the Community forums!