Binding object (JavaScript API for Office v1.1)

JavaScript API for Office v1.1

An abstract class that represents a binding to a section of the document.

Last modified: June 12, 2014

Introduced in Office.js version

1.0

Updated in Office.js version

1.1

Office.context.document.bindings.getByIdAsync(id);
Office.select("bindings#id);

Objects

Name

Description

Updates for Office.js v1.1

MatrixBinding

Represents a binding in two dimensions of rows and columns.

TableBinding

Represents a binding in two dimensions of rows and columns, optionally with headers.

Added support for table binding in content apps for Access.

TextBinding

Represents a bound text selection in the document.

Properties

Name

Description

Updates for Office.js v1.1

document

Get the Document object associated with the binding.

Added support for table binding in content apps for Access.

id

Gets the identifier of the object.

Added support for table binding in content apps for Access.

type

Gets the type of the binding.

Added support for table binding in content apps for Access.

Methods

Name

Description

Updates for Office.js v1.1

addHandlerAsync

Adds a handler to the binding for the specified event type.

Added support for table binding in content apps for Access.

getDataAsync

Returns the data contained within the binding.

Added support for table binding in content apps for Access.

removeHandlerAsync

Removes the specified handler from the binding for the specified event type.

Added support for table binding in content apps for Access.

setDataAsync

Writes data to the bound section of the document represented by the specified binding object.

Events

Name

Description

Updates for Office.js v1.1

dataChanged

Occurs when data within the binding is changed.

Added support for table binding in content apps for Access.

selectionChanged

Occurs when the selection is changed within the binding.

Added support for table binding in content apps for Access.

The Binding object exposes the functionality possessed by all bindings regardless of type.

The Binding object is never called directly. It is the abstract parent class of the objects that represent each type of binding: MatrixBinding, TableBinding, or TextBinding. All three of these objects inherit the getDataAsync and setDataAsync methods from the Binding object that enable to you interact with the data in the binding. They also inherit the id and type properties for querying those property values. Additionally, the MatrixBinding and TableBinding objects expose additional methods for matrix- and table-specific features, such as counting the number of rows and columns.

App types

Content apps, Task pane apps

Supported clients

Access app for SharePoint, Excel 2013, Excel 2013 SP1, Excel 2013 RT, Excel Online, Word 2013, Word 2013 SP1, Word 2013 RT

Library

Office.js

Namespace

Office

Show:
© 2014 Microsoft