Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Excel.EntityViewLayouts interface
- Package:
- excel
Represents layout information for various views of the entity.
Remarks
Used by
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/20-data-types/data-types-entity-attribution.yaml
function makeProductEntity(productID: number, productName: string, product?: any) {
const entity: Excel.EntityCellValue = {
type: Excel.CellValueType.entity,
text: productName,
properties: { /* Excel.EntityPropertyType */
"Product ID": {
type: Excel.CellValueType.string,
basicValue: productID.toString() || ""
},
"Product Name": {
type: Excel.CellValueType.string,
basicValue: productName || ""
},
"Quantity Per Unit": {
type: Excel.CellValueType.string,
basicValue: product.quantityPerUnit || ""
},
// Add Unit Price as a formatted number.
"Unit Price": {
type: Excel.CellValueType.formattedNumber,
basicValue: product.unitPrice,
numberFormat: "$* #,##0.00"
},
"Units In Stock": {
type: Excel.CellValueType.double,
basicValue: product.unitsInStock
},
"Units On Order": {
type: Excel.CellValueType.double,
basicValue: product.unitsOnOrder
},
"Reorder Level": {
type: Excel.CellValueType.double,
basicValue: product.reorderLevel
}
},
layouts: { /* Excel.EntityViewLayouts */
card: { /* Excel.EntityCardLayout */
title: { property: "Product Name" },
sections: [ /* Excel.CardLayoutSection */
{
layout: "List",
properties: ["Product ID"]
},
{
layout: "TwoColumn", /* Excel.CardLayoutTwoColumnSection */
title: "Quantity and price",
collapsible: true,
collapsed: false,
properties: ["Quantity Per Unit", "Unit Price"]
},
{
layout: "Table", /* Excel.CardLayoutTableSection */
title: "Stock information",
collapsible: true,
collapsed: false,
properties: ["Units In Stock", "Units On Order", "Reorder Level"]
}
]
}
},
provider: {
description: product.providerName, // Name of the data provider. Displays as a tooltip when hovering over the logo. Also displays as a fallback if the source address for the image is broken.
logoSourceAddress: product.sourceAddress, // Source URL of the logo.
logoTargetAddress: product.targetAddress // URL to open when you select the logo.
}
};
return entity;
}
Properties
| card | Represents the layout of this entity in card view. If the |
| compact | Represents the layout used when there is limited space to represent the entity. |
Property Details
card
Represents the layout of this entity in card view. If the CardLayout object does not have a layout property, it is assumed to be "Entity".
card?: CardLayout;
Property Value
Remarks
compact
Represents the layout used when there is limited space to represent the entity.
compact?: CompactLayout;
Property Value
Remarks
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
