It is recommended to read the documentation about Data beforehand.
The Tabular View widget can be created through the widgets API using either of the createTabularView
or createPivotTable
methods.
Both methods return a SingleMdxQueryBuilder.
The Tabular View / Pivot Table can be configured through a JavaScript object provided to its SingleMdxQueryBuilder
.
The configuration allows to configure a widget without using UI controls, or sometimes allows to control options that do not have a UI control.
Here is a sample code to generate a Tabular View and a Pivot Table using a simple query, but hiding the line numbers shown by default:
const activeUI = ActiveUI.initialize();
const servers = activeUI.queries.serversPool;
const url = `localhost`;
const activeMonitorServer = servers.addActiveMonitorServer({url: `${url}:8081`});
const activePivotServer = servers.addActivePivotServer({url: `${url}:9090`, activeMonitorServer});
const simpleQuery = activePivotServer.createSelectQueryFromCube('EquityDerivativesCube').getMdx();
activeUI.widgets
.createTabularView()
.withConfiguration({
tabular: {
lineNumbers: false
}
})
.withMdx(simpleQuery)
.within('tabular-view');
activeUI.widgets
.createPivotTable()
.withConfiguration({
tabular: {
lineNumbers: false
},
shouldRenderWizard: true,
wizard: {}
})
.withMdx(simpleQuery)
.within('pivot-table');
Here is an exhaustive 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, 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.