Office.BindingDataChangedEventArgs interface
Fornece informações sobre a associação que gerou o evento DataChanged.
Comentários
Usada por
Exemplos
// 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);
}
});
}
Propriedades
| binding | Obtém um objeto Office.Binding que representa o enlace que elevou o evento DataChanged. |
| type | Obtém um valor de enumeração Office.EventType que identifica o tipo de evento que foi gerado. |
Detalhes da propriedade
binding
Obtém um objeto Office.Binding que representa o enlace que elevou o evento DataChanged.
binding: Binding;
Valor da propriedade
type
Obtém um valor de enumeração Office.EventType que identifica o tipo de evento que foi gerado.
type: EventType;