HtlmTableDatatable 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.html.tables.HtlmTableDatatable.Table(page: PageModel, records, width, height, html_code, options, profile)
build(data: Optional[Union[str, JsDataModel, float, dict, list, bool]] = None, options: Optional[Union[bool, dict]] = None, profile: Optional[Union[bool, dict]] = False, component_id: Optional[str] = None, stop_state: bool = True, dataflows: Optional[List[dict]] = None) str
Parameters:
  • data – 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. The component reference (the htmlCode)

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

  • dataflows – Chain of data transformations

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

  • dataflows

Returns:

property dom: JsHtml

Return all the Javascript functions defined for an HTML Component. Those functions will use plain javascript available for a DOM element by default.

Usage:

div = page.ui.div(htmlCode="testDiv")
print(div.dom.content)
Returns:

A Javascript Dom object.

get_column(by_title: str)

Get the column object from it is title.

Parameters:

by_title

property js: DatatableAPI

Return the Javascript internal object.

Returns:

A Javascript object

property options: TableConfig

Datatable table options.

property style: Datatable

Property to the CSS Style of the component.

property tableId: str

Return the Javascript variable of the chart.