Interface: ICardBodyContentLabelBarItemProxy¶
A designer-facing interface that provides access to card body content item properties.
example
// Example rule bound to the Image property of a label bar item
export default function GetLabelBarItemImage(context) {
const cardBodyContentLabelBarItemProxy = context;
// Access parent label bar
const labelBarProxy = cardBodyContentLabelBarItemProxy.getParent();
const hasItemSeparator = labelBarProxy.getItemSeparator();
// Access section
const sectionProxy = cardBodyContentLabelBarItemProxy.getSectionProxy();
const sectionName = sectionProxy.getName();
// Get item position
const itemIndex = cardBodyContentLabelBarItemProxy.getItemIndex();
// Return different icons based on item position
return itemIndex === 0 ? 'sap-icon://warning' : 'sap-icon://information';
}
Hierarchy¶
-
ICardBodyContentLabelBarItemProxy
Implemented by¶
Summary¶
Properties¶
Class Properties¶
Currently none in this class.
Inherited Properties¶
Methods¶
Class Methods¶
Inherited Methods¶
Methods¶
getItemIndex¶
▸ getItemIndex(): number
Get item index
example
// Access item position
const position = cardBodyContentLabelBarItemProxy.getItemIndex();
console.log(`This is item #${position} in the label bar`);
Returns: number
getParent¶
▸ getParent(): ICardBodyContentProxy
Overrides IElementProxy.getParent
This method returns CardBodyContentProxy
example
// Access parent label bar
const labelBarProxy = cardBodyContentLabelBarItemProxy.getParent();
const layout = labelBarProxy.getLayout();
const layoutType = layout.getLayoutType();
Returns: ICardBodyContentProxy
getSectionProxy¶
▸ getSectionProxy(): any
Overrides ICardElementProxy.getSectionProxy
This method returns CardCollection proxy
example
// Access section proxy
const sectionProxy = cardBodyContentLabelBarItemProxy.getSectionProxy();
const sectionName = sectionProxy.getName();
Returns: any