Namespace: databinding

Child classes
AlreadyBoundError

An error that is thrown when attempting to bind a DOM element which has already been bound to a collaborative value.

Binding
Method
bindString(string, textInputElement) non-null gapi.drive.realtime.databinding.Binding

Binds a text input element to an collaborative string. Once bound, any change to the collaborative string (including changes from other remote collaborators) is immediately displayed in the text editing control. Conversely, any change in the text editing control is reflected in the data model.

Method

static
bindString(string, textInputElement) → gapi.drive.realtime.databinding.Binding

Binds a text input element to an collaborative string. Once bound, any change to the collaborative string (including changes from other remote collaborators) is immediately displayed in the text editing control. Conversely, any change in the text editing control is reflected in the data model.

Parameters

Name Type Optional Description

string

gapi.drive.realtime.CollaborativeString

 

The collaborative string to bind.

Value must not be null.

textInputElement

HTMLInputElement

 

The text input element to bind. This must be a textarea element or an input type=text element.

Value must not be null.

Throws

TypeError If string is not a CollaborativeString, or if textInputElement is not a texarea element or input type=text element.

gapi.drive.realtime.databinding.AlreadyBoundError If the element has already been bound to a collaborative string.

Returns

non-null gapi.drive.realtime.databinding.Binding A binding registration that can be later used to remove the binding.

Send feedback about...

Realtime API
Realtime API