Module

Table

The table widget displays data as a simple table, distributed in columns and rows.

This widget is based on datatables library.

Tutorials:
See:

View Source widgets/dataTables.js, line 7

Methods

# setArrayColumns(targetColumns)

Set the columns that should represent an array of values.

Parameters:
Name Type Description
targetColumns Array | number | string

Columns to apply the definitions.

See:

View Source widgets/dataTables.js, line 296

# setColumnDefs(defs)

Set specific options to columns in the table.

Parameters:
Name Type Description
defs Array.<Object>

Array of columnDefs objects.

See:

View Source widgets/dataTables.js, line 66

# setColumnRenderers(targetColumns, render)

Set arbitrary renderers to the given columns.

Parameters:
Name Type Description
targetColumns Array | number | string

Columns to apply the definitions.

render function | Object | string | number

Process to apply.

See:

View Source widgets/dataTables.js, line 249

# setColumnsOrder(order)

Set the order of the columns to be displayed in the table based on the values of the query.

Parameters:
Name Type Description
order Array.<int>

Index of columns.

View Source widgets/dataTables.js, line 107

# setCreatedRow(func)

Callback executed when a row (TR element) is created.

Parameters:
Name Type Description
func function

Callback JavaScript function.

See:

View Source widgets/dataTables.js, line 189

# setCustomClass(classes)

Add custom class to table element.

Parameters:
Name Type Description
classes string

Name of clases.

View Source widgets/dataTables.js, line 236

# setDom(str)

Set the table control elements to appear on the page and in what order. https://datatables.net/reference/option/dom

Parameters:
Name Type Description
str string

Dom value.

See:

View Source widgets/dataTables.js, line 97

# setDrawCallback(func)

Set a function that is called before every draw of the table.

Parameters:
Name Type Description
func function

Callback JavaScript function.

See:

View Source widgets/dataTables.js, line 86

# setFilter(boo)

Allow to show the filter.

Parameters:
Name Type Description
boo boolean

Enable or disable.

View Source widgets/dataTables.js, line 207

# setFooterInfo(bool)

Allow to show information about the table.

Parameters:
Name Type Description
bool boolean

Enable or disable.

See:

View Source widgets/dataTables.js, line 227

# setLabels(arr)

Set the array of labels to show as series title. Override the processed ones.

Parameters:
Name Type Description
arr Array.<string>

Array of strings

View Source widgets/dataTables.js, line 56

# setLanguage(language)

Set the language configuration.

Parameters:
Name Type Description
language object

Language object.

See:

View Source widgets/dataTables.js, line 117

# setLengthChange(lengthChange)

Allow to change the paging display length of the table.

Parameters:
Name Type Description
lengthChange boolean

Enable or disable.

See:

View Source widgets/dataTables.js, line 158

# setLimit(limit)

Set the limit of data to show without any kind of order.

Parameters:
Name Type Description
limit number

Limit value.

View Source widgets/dataTables.js, line 35

# setMenuLength(lengthMenu)

Change the options in the page length select list.

Parameters:
Name Type Description
lengthMenu Array.<Array>

Array of int values.

Default Value:
  • [ 10, 25, 50, 100 ]
See:

View Source widgets/dataTables.js, line 179

# setNoWrapColumns(targetColumns)

Set which columns should not wrap the text.

Parameters:
Name Type Description
targetColumns Array | number | string

Columns to apply the definitions.

See:

View Source widgets/dataTables.js, line 281

# setOrder(order)

Set the initial order for the table.

Parameters:
Name Type Description
order Array
0 index

Index of the column

1 string

Order to sorting. desc or asc.

View Source widgets/dataTables.js, line 46

# setPageLength(pageLength)

Set the default number of rows per page.

Parameters:
Name Type Description
pageLength number

Default page length.

See:

View Source widgets/dataTables.js, line 168

# setPaging(bool)

Allow table pagination.

Parameters:
Name Type Description
bool boolean

Enable or disable.

See:

View Source widgets/dataTables.js, line 217

# setPagingType(pagingType)

Set the pagination type.

  • numbers: Page number buttons only.
  • simple: Previous and Next buttons only.
  • simple_numbers: Previous and Next buttons, plus page numbers.
  • full: First, Previous, Next and Last buttons.
  • full_numbers: First, Previous, Next and Last buttons, plus page numbers.
  • first_last_numbers: First and Last buttons, plus page numbers.
Parameters:
Name Type Description
pagingType string

Pagination type.

See:

View Source widgets/dataTables.js, line 317

# setRowClick(func)

Attach an event handler function to execute when a row is clicked.

Parameters:
Name Type Description
func function

Callback JavaScript function.

View Source widgets/dataTables.js, line 76

# setScrollCollapse(scrollCollapse)

Allow reduces the height of the table when a limited number of rows are shown.

Parameters:
Name Type Description
scrollCollapse boolean

Enable or disable.

See:

View Source widgets/dataTables.js, line 148

# setScrollX(bool)

Set the horizontal scrolling.

Parameters:
Name Type Description
bool boolean

Enable or disable.

See:

View Source widgets/dataTables.js, line 137

# setScrollY(scrollY)

Set the vertical scrolling.

Parameters:
Name Type Description
scrollY string

Value in pixels.

See:

View Source widgets/dataTables.js, line 127

# setToolTipColumns(targetColumns)

Renders a group of cells with a span and a tooltip.

Parameters:
Name Type Description
targetColumns Array | number | string

Columns to apply the definitions.

See:

View Source widgets/dataTables.js, line 264

# useExportWithVisual(bool)

Use the visual data for exported values.

Parameters:
Name Type Description
bool boolean

Enable or disable.

View Source widgets/dataTables.js, line 198