Class: IndexReference

Properties
DeleteMode string

The shift behavior of an index reference when the element it points at is deleted.

index number

The index of the current location the reference points to. Write to this property to change the referenced index.

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.

deleteMode() gapi.drive.realtime.IndexReference.DeleteMode

The behavior of this index reference when the element it points at is deleted.

id() string

The id of this collaborative object. Read-only.

referencedObject() gapi.drive.realtime.CollaborativeObject

The object this reference points to. Read-only.

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.

type() string

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.

new IndexReference()

This class should not be instantiated directly. To create an index reference, call registerReference on the appropriate string or list.

Extends
gapi.drive.realtime.CollaborativeObject
See also
gapi.drive.realtime.CollaborativeString.prototype.registerReference()
gapi.drive.realtime.CollaborativeList.prototype.registerReference()
gapi.drive.realtime.EventType

Properties

static
DeleteMode  string

The shift behavior of an index reference when the element it points at is deleted.

Properties

Name Type Optional Description

SHIFT_AFTER_DELETE

string

 

The index shifts to the first element after the deleted range.

Defaults to shift_after_delete.

SHIFT_BEFORE_DELETE

string

 

The index shifts to the first element before the deleted range.

Defaults to shift_before_delete.

SHIFT_TO_INVALID

string

 

The index shifts to -1.

Defaults to shift_to_invalid.

index  number

The index of the current location the reference points to. Write to this property to change the referenced index.

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

deleteMode()

The behavior of this index reference when the element it points at is deleted.

id()

The id of this collaborative object. Read-only.

Inherited from
gapi.drive.realtime.CollaborativeObject#id

referencedObject()

The object this reference points to. 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.

Inherited from
gapi.drive.realtime.CollaborativeObject#toString
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.

Inherited from
gapi.drive.realtime.CollaborativeObject#type

Send feedback about...

Realtime API
Realtime API