Skip to content

Table Configuration

jwildfire edited this page Nov 18, 2019 · 14 revisions

Overview

Webcharts tables are configured using a process similar to the one described for chart objects. Full details of the settings object are provided below. Note that much of this functionality was added in version 1.9 and is not available in earlier versions.

Settings object

cols

array

List of columns to display in table

default: all properties in data array

headers

array

List of column headers to display in table

default: property names of data array

sortable

boolean

Add ability to click column headers to sort table?

default: true

searchable

boolean

Add search box to filter table?

default: true

exportable

boolean

Add data export?

default: true

exports

array

Array of data export formats. Valid options are currently limited to "csv" and "xlsx" (others are ignored). "xlsx" export requires the js-xlsx library.

default: ['csv']

pagination

boolean

Add pagination?

default: true

nRowsPerPage

number

Number of rows displayed per page. Ignored if config.pagination is false.

default: 10

nPageLinksDisplayed

number

Number of page links displayed at once. Ignored if config.pagination is false.

default: 5

applyCSS

boolean

Apply Webcharts table styles? User will almost certainly want to apply their own css rules (or use config.bootstrap) if set to false. Note that this also effects the controls for sortable, searchable and so on, so user will likely want to either disable those controls or style them in their custom css rules.

default: true

bootstrap

boolean

Gives the table class table, which activates a wide range of bootstrap styling if the library is loaded.

default: false

Deprecated Table Config options

Configuration options for row_per, data_manipulate and keep were never fully tested and are used rarely, if ever. They are being deprecated in v1.9.0 and will likely be removed entirely in v2.0.

Events

Events are implemented using a process similar to the one used for chart objects. The following events are supported via table.on("event", function(){}):

  • init
  • layout
  • datatransform
  • draw