Tabular View and Pivot Tables
We recommend reading the documentation about Data and <Container />
before looking at this page.
Configuration
The tabular view / pivot table can be configured through a JavaScript object inside the <Container />
's defaultValue
/value
prop.
The configuration enables you to configure a widget without using UI controls, or sometimes allows you to control options that do not have a UI control.
Below, you will see sample code that generates a Tabular View and a Pivot Table using a simple query, but hiding the line numbers shown by default:
const TabularView = () => (
<Container
defaultValue={{
name: 'Tabular View',
value: {
body: {
configuration: {
tabular: {
lineNumbers: false,
},
},
mdx: `SELECT FROM [EquityDerivativesCube]`,
},
containerKey: 'tabular-view',
},
}}
/>
);
const PivotTable = () => (
<Container
defaultValue={{
name: 'Tabular View',
value: {
body: {
configuration: {
tabular: {
lineNumbers: false,
},
showWizard: true,
wizard: {},
},
mdx: `SELECT FROM [EquityDerivativesCube]`,
},
containerKey: 'pivot-table',
},
}}
/>
);
Here is a list of configuration attributes for the Tabular View and Pivot Table widget:
key | Type | Effect | Comment |
---|---|---|---|
addButtonFilter | String | Filters the fields displayed when clicking on the add button | One of [all , literal , numeric , measure ] |
cellEditor | Plugin | The cell editor to use (called on cell double-click) | |
cellRenderer | Plugin | The cell renderer to use for the widget. It will be called for each cell of the table. | The default cell renderer is the caption cell renderer |
columnOrder | Array | ||
columns | Array | ||
columnsGroups | Array | ||
defaultOptions | Object | Options used by default for the columns | For example, use the key width to have a default width for each column |
handlers | Plugin | ||
lineNumbers | Boolean | True to show the line numbers | true by default |
minRowSize | Number | Minimum height in pixels for all rows | 31px by default |
rowAction | Array[Plugin] | The row actions to display in the view | The are displayed by default at the right end of the widget |
rowStyle | Array[Plugin] | The style to apply to row of the tabular | |
sortingMode | String | The sorting mode to use for this tabular | One of [breaking , non-breaking ] |
Note: None of these configuration attributes are necessary to render a widget. They are provided for an advanced configuration of the view.