Excel.LinkedEntityCellValueLoadedEventArgs interface

提供有关在给定指定 LinkedEntityId的情况下请求的 的信息LinkedEntityCellValue

注解

API 集:ExcelApi 1.21

使用方

示例

// Registers an event handler for the onLinkedEntityCellValueLoaded event.
async function registerEvent() {
    await Excel.run(async (context) => {
        const linkedEntityDataDomains: Excel.LinkedEntityDataDomainCollection = context.workbook.linkedEntityDataDomains;
        linkedEntityDataDomains.onLinkedEntityCellValueLoaded.add(handleLoadedLinkedEntity);

        await context.sync();
        console.log("Event handler registered successfully. You''ll be notified when linked entities are loaded.");
    });
}

// Handles the onLinkedEntityCellValueLoaded event that occurs when a linked entity cell value is loaded.
async function handleLoadedLinkedEntity(event: Excel.LinkedEntityCellValueLoadedEventArgs) {
    await Excel.run(async (context) => {
        console.log(`The ${event.type} event occurred from a ${event.source} source.`);
        console.log(`The linked entity cell value with ID ${event.id} is loaded.`);
        const loadedLinkedEntityCellValue: Excel.LinkedEntityCellValue = event.linkedEntityCellValue;
        console.log(`Loaded linked entity cell value: ${loadedLinkedEntityCellValue}`);

        // Queue operations on the loaded entity value here.

        await context.sync();
    });
}

属性

error

在请求加载 LinkedEntityCellValue期间遇到的任何错误。

id

LinkedEntityId获取所请求LinkedEntityCellValue的 的 。

linkedEntityCellValue

LinkedEntityCellValue获取所请求LinkedEntityId的 的 。 如果加载操作失败,此属性为 null

source

获取事件源。 有关详细信息,请参阅 Excel.EventSource

type

获取事件的类型。 有关详细信息,请参阅 Excel.EventType

属性详细信息

error

在请求加载 LinkedEntityCellValue期间遇到的任何错误。

error?: string;

属性值

string

注解

API 集:ExcelApi 1.21

id

LinkedEntityId获取所请求LinkedEntityCellValue的 的 。

id: LinkedEntityId;

属性值

注解

API 集:ExcelApi 1.21

linkedEntityCellValue

LinkedEntityCellValue获取所请求LinkedEntityId的 的 。 如果加载操作失败,此属性为 null

linkedEntityCellValue?: LinkedEntityCellValue;

属性值

注解

API 集:ExcelApi 1.21

source

获取事件源。 有关详细信息,请参阅 Excel.EventSource

source: Excel.EventSource | "Local" | "Remote";

属性值

Excel.EventSource | "Local" | "Remote"

注解

API 集:ExcelApi 1.21

type

获取事件的类型。 有关详细信息,请参阅 Excel.EventType

type: "LinkedEntityDataDomainLinkedEntityCellValueLoaded";

属性值

"LinkedEntityDataDomainLinkedEntityCellValueLoaded"

注解

API 集:ExcelApi 1.21