Popover
Anchors a small panel to an existing control.
kor/ui/PopoverSource
When to use
- Keep short detail or quick actions next to their trigger.
Examples
Anchored detail
<k:Button text="Show dispatch time" press=".onOpen">
<k:dependents>
<k:Popover id="details" title="Dispatch">
<k:Text text="Pickup begins at noon."/>
</k:Popover>
</k:dependents>
</k:Button>
sap.ui.define(["sap/ui/core/mvc/Controller"], (Controller) => Controller.extend("sample.DispatchPopover", {
onOpen(event) {
this.byId("details").openBy(event.getSource());
}
}));
Quick action
<k:Button text="Show dispatch options" press=".onOpen">
<k:dependents>
<k:Popover id="details" title="Dispatch">
<k:content><k:Text text="A driver needs to check in."/></k:content>
<k:footer><k:Button text="Notify driver" press=".onNotify"/></k:footer>
</k:Popover>
</k:dependents>
</k:Button>
sap.ui.define(["sap/ui/core/mvc/Controller", "kor/ui/Toast"], (Controller, Toast) => Controller.extend("sample.DispatchPopover", {
onOpen(event) {
this.byId("details").openBy(event.getSource());
},
onNotify() {
this.byId("details").close();
Toast.show("Driver notified");
}
}));
API
Properties
| Name | Type | Default | Description |
|---|
title | string | | Title |
width | int | 320 | Width in pixels |
Aggregations
| Name | Type | Description |
|---|
content | sap.ui.core.Control[] | Popover body |
footer | sap.ui.core.Control[] | Footer actions |
Events
| Name | Type | Description |
|---|
close | | The popover closed |
Methods
| Name | Description |
|---|
openBy(opener: Control | HTMLElement): void | Opens the popover beside the supplied control or element |
isOpen(): boolean | Returns whether the popover is open |
close(): void | Closes the popover |
Related
TooltipSheet