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