Office.BindingDataChangedEventArgs interface
DataChanged イベントが発生したバインドに関する情報を提供します。
注釈
使用元
例
// 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);
}
});
}
プロパティ
| binding | DataChanged イベントを発生させたバインドを表す Office.Binding オブジェクトを取得します。 |
| type | 発生したイベントの種類を識別する Office.EventType 列挙値を取得します。 |