The table widget displays data as a simple table, distributed in columns and rows.
This widget is based on datatables library.
- Tutorials:
- See:
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. |
# setColumnDefs(defs)
Set specific options to columns in the table.
Parameters:
Name | Type | Description |
---|---|---|
defs |
Array.<Object>
|
Array of columnDefs objects. |
# 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. |
# 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. |
# setCreatedRow(func)
Callback executed when a row (TR element) is created.
Parameters:
Name | Type | Description |
---|---|---|
func |
function
|
Callback JavaScript function. |
# setCustomClass(classes)
Add custom class to table element.
Parameters:
Name | Type | Description |
---|---|---|
classes |
string
|
Name of clases. |
# 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. |
# setDrawCallback(func)
Set a function that is called before every draw of the table.
Parameters:
Name | Type | Description |
---|---|---|
func |
function
|
Callback JavaScript function. |
# setFilter(boo)
Allow to show the filter.
Parameters:
Name | Type | Description |
---|---|---|
boo |
boolean
|
Enable or disable. |
# setFooterInfo(bool)
Allow to show information about the table.
Parameters:
Name | Type | Description |
---|---|---|
bool |
boolean
|
Enable or disable. |
# 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 |
# setLanguage(language)
Set the language configuration.
Parameters:
Name | Type | Description |
---|---|---|
language |
object
|
Language object. |
# setLengthChange(lengthChange)
Allow to change the paging display length of the table.
Parameters:
Name | Type | Description |
---|---|---|
lengthChange |
boolean
|
Enable or disable. |
# setLimit(limit)
Set the limit of data to show without any kind of order.
Parameters:
Name | Type | Description |
---|---|---|
limit |
number
|
Limit value. |
# 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:
# setNoWrapColumns(targetColumns)
Set which columns should not wrap the text.
Parameters:
Name | Type | Description |
---|---|---|
targetColumns |
Array
|
number
|
string
|
Columns to apply the definitions. |
# 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. |
# setPageLength(pageLength)
Set the default number of rows per page.
Parameters:
Name | Type | Description |
---|---|---|
pageLength |
number
|
Default page length. |
# setPaging(bool)
Allow table pagination.
Parameters:
Name | Type | Description |
---|---|---|
bool |
boolean
|
Enable or disable. |
# 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. |
# setRowClick(func)
Attach an event handler function to execute when a row is clicked.
Parameters:
Name | Type | Description |
---|---|---|
func |
function
|
Callback JavaScript function. |
# 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. |
# setScrollX(bool)
Set the horizontal scrolling.
Parameters:
Name | Type | Description |
---|---|---|
bool |
boolean
|
Enable or disable. |
# setScrollY(scrollY)
Set the vertical scrolling.
Parameters:
Name | Type | Description |
---|---|---|
scrollY |
string
|
Value in pixels. |
# 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. |
# useExportWithVisual(bool)
Use the visual data for exported values.
Parameters:
Name | Type | Description |
---|---|---|
bool |
boolean
|
Enable or disable. |