TableComponent

Description

This is a component that can easily generate a data table without needing a xaction file. The underlying plugin use is http://datatables.net. The resultset is returned from a mdx or sql query. In case of mdx queries, a role will be passed to mondrian if the session variable 'role' is defined, allowing row level security.

Options

name
The name of the component
type
tableComponent
listeners
Array - Parameters who this component will react to
chartDefinition
MetaLayer object with the definition of chart (see MetaLayer options)
htmlObject
Id of the component (usually a div or a span tag) to be replaced by the result
refreshPeriod
Time in seconds for this component to refresh. Default is 0 (disabled)
executeAtStart
True to execute the component at start, false otherwise
tooltip
Tooltip to be displayed when mouse hovers
preExecution
Function - Function to be called before the component is executed
postExecution
Function - Function to be called after the component is executed
failureCallback
Function - Function to be called after a failed query

MetaLayer options

queryType
Type of query to read results from. Can be sql or mdx. Default: mdx
jndi
Connection to use for the query
query
sql or mdx Query to execute
cube
Cube name to use when queryType is mdx
catalog
Mondrian schema to use when queryType is mdx
colHeaders
The table column header. Required: true
colTypes
The table column types.
colFormats
The table column formats in sprinf format
colWidths
The table column widths. Works with percentages or points
colSortable
Array that indicates if the columns are sortable
colSearchable
Array that indicates if the columns are searchable
paginate
Enables or disables pagination. Default: true
paginationType
The pagination type to be used. Possible values: "simple", "simple_numbers", "full", "full_numbers" and "two_button". Default: "simple_numbers"
paginateServerside
Whether the pagination should be handled by the server instead of the client. This feature requires a CDA Datasource! Default: false. When both paginateServerSide and filter features are set to true, then filtering of data will be performed server-side; the input typed in the searchbox will be sent in request (paramsearchBox).
filter
Enable or disable filtering of data. Note that filtering in DataTables is smart in that it allows the end user to input multiple words (space separated) and will match a row containing those words, even if not in the order that was specified (this allow matching across multiple columns). Default: true
info
Enable or disable the table information display. This shows information about the data that is currently visible on the page, including information about filtered data if that action is being performed. Default: true
sort
Sorts the data. Default: true
sortBy
If sorting is enabled, then DataTables will perform a first pass sort on initialisation. You can define which column(s) the sort is performed upon, and the sorting direction, with this variable. For each column an array must be specified where the first element is an int of the data index, and the second is 'asc' or 'desc' for the sorting direction Example of multiple column sorting: "[[0,'asc'], [1,'asc']]"
displayLength
Number of rows to display on a single page when using pagination. If feature enabled (bLengthChange) then the end user will be able to over-ride this to a custom setting using a pop-up menu. Default: 10
lengthChange
Allows the end user to select the size of a formatted page from a select menu (sizes are 10, 25, 50 and 100). Default: true
tableStyle
The style of the table to render. Possible values: classic and themeroller. Default: classic
drawCallback
Optinal function to be called when a page of the table is rendered. Takes the component object as argument. Example: function(component){if (typeof component == 'undefined'){return}; alert("Page draw")}
sDom
This initialisation variable allows you to specify exactly where in the DOM you want DataTables to inject the various controls it adds to the page (for example you might want the pagination controls at the top of the table). DIV elements (with or without a custom class) can also be added to aid styling. See http://datatables.net/usage/options for more details
oLanguage
Object used for the translation. See http://datatables.net/usage/options for more details. Example:
          oLanguage:{
          "sProcessing": "A processar...",
          "sLengthMenu": "Mostrar _MENU_ registos",
          "sZeroRecords": "Não foram encontrados resultados",
          "sInfo": "Mostrando de _START_ até _END_ de _TOTAL_ registos",
          "sInfoEmpty": "Mostrando de 0 até 0 de 0 registros",
          "sInfoFiltered": "(filtrado de _MAX_ registos no total)",
          "sInfoPostFix": "",
          "sSearch": "Procurar:",
          "sUrl": "",
          "oPaginate": {
          "sFirst": "Primeiro",
          "sPrevious": "Anterior",
          "sNext": "Seguinte",
          "sLast": "Último"
          }
          }
        

Component objects

dataTable
After the datatable plugin is applied, the base object can be access through this object

Sample