Pivot
Summarizes records by rows and columns.
When to use
- Use it for up to several thousand records already in the browser.
Examples
Sales by region
Loading the example
<k:Pivot data="{/sales}" rows="region,product" column="year" value="amount" unit="TRY" rowLabel="Region" expandedLevels="2" cellPress=".onPress"/>sap.ui.define(["sap/ui/core/mvc/Controller", "kor/ui/Toast"], (Controller, Toast) => Controller.extend("sample.Sales", {
onPress(event) {
Toast.show(String(JSON.stringify(event.getParameter("filters"))));
}
}));API
Properties
| Name | Type | Default | Description |
|---|---|---|---|
data | any | null | Array of records |
rows | string[] | [] | Row fields, outermost first |
column | string | Column field | |
value | string | Field to aggregate | |
aggregate | string | sum | sum, count, avg, min or max |
decimals | int | 0 | Decimal places |
unit | string | Unit | |
label | string | Accessible name | |
rowLabel | string | Heading of the first column | |
expandedLevels | int | 1 | Levels visible at first. 1 shows only the first level |
height | string | Height. Defaults to the content |
Events
| Name | Type | Description |
|---|---|---|
cellPress | filters: objectvalue: any | A cell was pressed. Provides field and value pairs |