Class: CollaborativeObject

Property
id string

The id of this collaborative object. Read-only.

type string

The type of this collaborative object. For standard collaborative objects, see gapi.drive.realtime.CollaborativeType for possible values; for custom collaborative objects, this value is application-defined.

Methods
addEventListener(type, listener[, opt_capture]) void

Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched.

removeAllEventListeners() void

Removes all event listeners from this object.

removeEventListener(type, listener[, opt_capture]) void

Removes an event listener from the event target. The handler must be the same object as the one added. If the handler has not been added then nothing is done.

toString() string

Returns a string representation of this collaborative object.

new CollaborativeObject()

This class should not be instantiated directly. Use the create* methods on gapi.drive.realtime.Model to create specific types of collaborative objects.

Extends
gapi.drive.realtime.EventTarget

Methods

addEventListener(type, listener[, opt_capture])

Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched.

Parameters

Name Type Optional Description

type

string

 

The type of the event to listen for.

listener

(non-null function() or non-null EventListener)

 

The function to handle the event. The handler can also be an object that implements the handleEvent method which takes the event object as argument.

opt_capture

boolean

Yes

Whether to handle the event target in the capture phase instead of the bubble phase.

Inherited from
gapi.drive.realtime.EventTarget#addEventListener

id()

The id of this collaborative object. Read-only.

removeAllEventListeners()

Removes all event listeners from this object.

Inherited from
gapi.drive.realtime.EventTarget#removeAllEventListeners

removeEventListener(type, listener[, opt_capture])

Removes an event listener from the event target. The handler must be the same object as the one added. If the handler has not been added then nothing is done.

Parameters

Name Type Optional Description

type

gapi.drive.realtime.EventType

 

The type of the event to listen for.

listener

(non-null function() or non-null EventListener)

 

The function to or EventListener to remove.

opt_capture

boolean

Yes

Whether to handle the event target in the capture phase instead of the bubble phase.

Inherited from
gapi.drive.realtime.EventTarget#removeEventListener

toString() → string

Returns a string representation of this collaborative object.

Returns

string A string representation.

type()

The type of this collaborative object. For standard collaborative objects, see gapi.drive.realtime.CollaborrativeType for possible values; for custom collaborative objects, this value is application-defined.

Send feedback about...

Realtime API
Realtime API