HtmlTableTabulator Module

class epyk.core.html.tables.HtmlTableTabulator.Table(page: PageModel, records, width, height, html_code, options, profile)
add_column(field: Optional[str] = None, title: Optional[str] = None)

Add new column to the underlying Tabulator object.

Usage:

table = page.ui.table(randoms.languages)
c = table.add_column()
c.formatter = "rowSelection"
c.titleFormatter = "rowSelection"
c.hozAlign = "center"
c.headerSort = False
c.cellClick(["cell.getRow().toggleSelect()"])
Parameters:
  • field – Optional. The key in the row

  • title – Optional. The title for the column. Default to the field

build(data: Optional[Union[str, JsDataModel, float, dict, list, bool]] = None, options: Optional[Union[bool, dict]] = None, profile: Optional[Union[bool, dict]] = None, component_id: Optional[str] = None, stop_state: bool = True, dataflows: Optional[List[dict]] = None)

Common JavaScript function to add data to the table.

Usage:

tab = page.ui.tables.tabulators.table()
page.ui.button("Update Tabulator").click([
  tab.define([{"field": "col1", "title": "Column 1"}]),
  tab.build([{"col1": "row %s" % i}for i in range(n)])])
Parameters:
  • data – Optional. A String corresponding to a JavaScript object

  • options – Optional. Specific Python options available for this component

  • profile – Optional. A flag to set the component performance storage

  • component_id – Optional. Change the component id if specific

  • stop_state – Remove the top panel for the component state (error, loading…)

  • dataflows – Chain of data transformations

click(js_funcs: Union[List[Union[str, JsDataModel]], str], profile: Optional[Union[bool, dict]] = None, source_event: Optional[str] = None, on_ready: bool = False, data_ref: str = 'data')

Use a rowClick event as underlying click event.

Use the function row.getData() to make the data available.

Parameters:
  • js_funcs – Javascript functions

  • profile – Optional. A flag to set the component performance storage

  • source_event – Optional. The JavaScript DOM source for the event (can be a sug item)

  • on_ready – Optional. Specify if the event needs to be trigger when the page is loaded

  • data_ref – JavaScript variable name for the main data in the function (default data)

property config: TableConfig

Tabulator configuration options.

Deprecated and replaced by component options.

data(data)

Add data to the table.

Parameters:

data – Data object

define(options: Optional[Union[str, JsDataModel, float, dict, list, bool]] = None, dataflows: Optional[List[dict]] = None)

Common JavaScript function to set the table columns definition.

Usage:

tab = page.ui.tables.tabulators.table()
page.ui.button("Update Tabulator").click([
  tab.define([{"field": "col1", "title": "Column 1"}]),])
Parameters:
  • options – Optional. The header attributes

  • dataflows – Chain of config transformations

property dom: JsHtmlTabulator

HTML Dom object.

extendModule(category: str, type: str, func_name: str, func_def: str)

Tabulator is built in a modular fashion with a core codebase providing basic table rendering functionality and a series of modules that provide all of its wonderful features.

All of the available modules are installed by default to ensure that you can provide your users with the richest experience possible with minimal setup.

Related Pages:

Parameters:
  • category – The name of the module. e.g format

  • type – The name of the property you want to extend. e.g. formatters

  • func_name – The alias of teh function to be added to the registry

  • func_def – The function definition to be attached to this function name

get_column(by_field: Optional[str] = None, by_title: Optional[str] = None) Column

Get the column from the underlying Tabulator object by field or by title.

Pointing by field is recommended as the title might change quite easily.

This function will only get columns defined from the Python side.

Parameters:
  • by_field – Optional. The field reference for the column

  • by_title – Optional. The title reference for the column

get_columns() Generator[Column, None, None]

Get a generator with all the columns defined for the table on the Python side.

This function will only return columns defined from the Python side.

headers(cols_def: dict)

Update the header definition thanks to a static configuration.

Parameters:

cols_def – The header definition

property js: Tabulator

Return the Javascript internal object specific to this package.

Returns:

A Javascript object

property options: TableConfig

Tabulator table options.

property style: Tabulator

Property to the CSS Style of the component.

property tableId

Return the Javascript variable of the chart.

class epyk.core.html.tables.HtmlTableTabulator.TableTree(page: PageModel, records, width, height, html_code, options, profile)
property options: TableTreeConfig

Tabulator table options.