HtmlTableTabulator Module

class epyk.core.data.DataClass.DataClass(component: Optional[HtmlModel] = None, attrs: Optional[dict] = None, options: Optional[dict] = None, page: Optional[PageModel] = None)
add(name: str, value: Any)

Add the key and value to the final result object.

Parameters:
  • name – The key in the final data dictionary.

  • value – The value in the final data dictionary.

attr(name: str, value: Any)

Add an attribute to the Javascript underlying dictionary.

Parameters:
  • name – The attribute name

  • value – The attribute value

Returns:

“Self” to allow the chains on the Python side

attrs()
config_attrs(options: Optional[dict] = None) str

Get the attributes in a string.

Parameters:

options – Dictionary with specific attributes to be set

custom(name: str, value: Any)

Custom function to add a bespoke attribute to a class.

This entry point will not be able to display any documentation but it is a shortcut to test new features. If the value is a Javascript object, the PyJs object must be used.

Parameters:
  • name – The key to be added to the attributes

  • value – The value of the defined attributes

Returns:

The DataAttrs to allow the chains

get(dfl: Optional[Union[str, bool, int, dict, list, float]] = None, name: Optional[str] = None)

Get the attribute to the underlying attributes dictionary.

Parameters:
  • dfl – Optional. The default value of this attribute

  • name – Optional. The attribute name. default the name of the function

has_attribute(cls_obj)

Add an extra sub layer to the data structure.

The key in the object representation will be the function name.

Parameters:

cls_obj – Class. The sub data class used in the structure definition

set(value: Any, name: Optional[str] = None)

Add an attribute to the Javascript underlying dictionary.

Parameters:
  • value – The attribute value

  • name – Optional. The attribute name. default the name of the functin.

Returns:

“Self” to allow the chains on the Python side

sub_data(name: str, cls_obj)

Add an extra sub layer to the data structure. The key in the object representation will be the function name.

Should use has_attribute is the name can be deduced from the parent function.

Parameters:
  • name – The key to be added to the internal data dictionary

  • cls_obj – Class. Object. The object which will be added to the nested data structure

sub_data_enum(name: str, cls_obj)

Add key to a sub dictionary. This will create an attribute object with a nested structure.

Parameters:
  • name – The key to be added to the internal data dictionary

  • cls_obj – Class. Object. The object which will be added to the nested data structure

update(vals: dict)

Update the object internal attributes.

Parameters:

vals – All the attributes to be added to the component

class epyk.core.data.DataClass.DataEnum(component, value: Optional[Any] = None)
custom(value: str)

Set a custom value.This will not use any specific conversion.

Parameters:

value – The value to be set.

set(value: Optional[Union[JsDataModel, str]] = None)

Set the selected value in this enumeration. The last function call will be persisted.

Parameters:

value – Optional. The value to be set (default is the function name).

class epyk.core.data.DataClass.DataEnumMulti(page: PageModel, value: Optional[Any] = None)
custom(value: str)

Set a custom value.This will not use any specific conversion.

Parameters:

value – The value to be set.

set(value: Optional[str] = None)

Set the selected value in this enumeration. The last function call will be persisted.

Parameters:

value – Optional. The value to be set (default is the function name).

class epyk.core.data.DataClass.DataGroup(page: PageModel, attrs: dict, parent=None)
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.