Excel.LinkedEntityDataDomainRefreshMode enum
Stellt die Aktualisierungsmoduseinstellung für die LinkedEntityCellValue Objekte einer .LinkedEntityDataDomain
Hinweise
Verwendet von
- Excel.LinkedEntityDataDomain: refreshMode, supportedRefreshModes
- Excel.LinkedEntityDataDomainCreateOptions: supportedRefreshModes
- Excel.LinkedEntityDataDomainRefreshModeChangedEventArgs: refreshMode
Beispiele
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/20-data-types/data-types-linked-entities.yaml
// Register the product, category, and supplier data sources with Excel.
await Excel.run(async (context) => {
const domains: Excel.LinkedEntityDataDomainCollection = context.workbook.linkedEntityDataDomains;
const refreshModes: Excel.LinkedEntityDataDomainRefreshMode[] = [
Excel.LinkedEntityDataDomainRefreshMode.manual,
Excel.LinkedEntityDataDomainRefreshMode.onLoad,
Excel.LinkedEntityDataDomainRefreshMode.periodic
];
// Script Lab prefixes the function ID with the companion sample's name, without spaces.
const loadFunctionId = "LINKEDENTITYLOADSERVICE.CONTOSOLOADSERVICE";
const options: Excel.LinkedEntityDataDomainCreateOptions[] = [
{
dataProvider: "Contoso",
id: "products",
name: "Products",
loadFunctionId,
periodicRefreshInterval: 300,
supportedRefreshModes: refreshModes
},
{
dataProvider: "Contoso",
id: "categories",
name: "Categories",
loadFunctionId,
periodicRefreshInterval: 300,
supportedRefreshModes: refreshModes
},
{
dataProvider: "Contoso",
id: "suppliers",
name: "Suppliers",
loadFunctionId
}
];
// Replace only this sample's domains so registration is repeatable.
const existingDomains: Excel.LinkedEntityDataDomain[] = options.map((options) =>
domains.getItemOrNullObject(options.id)
);
await context.sync();
existingDomains.forEach((domain) => {
if (!domain.isNullObject) {
domain.delete();
}
});
options.forEach((options) => domains.add(options));
await context.sync();
console.log("Registered Products, Categories, and Suppliers. Manual refresh is the default.");
});
Felder
| manual = "Manual" | Manuelle Aktualisierung durch den Benutzer. Die Aktualisierung wird nicht automatisch ausgelöst. |
| onLoad = "OnLoad" | Beim Laden der Arbeitsmappe aktualisieren, gilt für verknüpfte Entitätsdatendomänen, die von Dienstdatenanbietern wie Bing oder Power BI definiert wurden. Aktualisierung beim Laden des Add-Ins, gilt für verknüpfte Entitätsdatendomänen, die von Office-Add-Ins definiert werden. |
| periodic = "Periodic" | Aktualisieren Sie automatisch basierend auf der Häufigkeit in Sekunden, die durch angegeben wird |
| unknown = "Unknown" | Der Aktualisierungsmodus ist unbekannt oder wird nicht unterstützt. |