Office.BindingDataChangedEventArgs interface
Provides information about the binding that raised the DataChanged event.
Remarks
Used by
Examples
// When data in a binding changes, the handler receives a BindingDataChangedEventArgs object
// containing the binding that changed and the event type.
function addDataChangeHandler() {
Office.context.document.bindings.getByIdAsync("myBinding", function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
asyncResult.value.addHandlerAsync(Office.EventType.BindingDataChanged, onDataChanged);
}
});
}
function onDataChanged(eventArgs: Office.BindingDataChangedEventArgs) {
console.log("Event type: " + eventArgs.type);
console.log("Binding ID: " + eventArgs.binding.id);
// Refresh data from the binding
eventArgs.binding.getDataAsync( { coercionType: Office.CoercionType.Text }, function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("Updated data: " + asyncResult.value);
}
});
}
Properties
| binding | Gets an Office.Binding object that represents the binding that raised the DataChanged event. |
| type | Gets an Office.EventType enumeration value that identifies the kind of event that was raised. |
Property Details
binding
Gets an Office.Binding object that represents the binding that raised the DataChanged event.
binding: Binding;
Property Value
type
Gets an Office.EventType enumeration value that identifies the kind of event that was raised.
type: EventType;