OptTable Module

class epyk.core.html.options.Options(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property builder

Add a JavaScript Builder function to the options.

This will be used to automatically map the Python component to its corresponding JavaScript builder function used by the build method.

Usage:

but = page.ui.button()
but.options.builder = "Button"
Prop value:

The JavaScript builder function name.

property config_default

The default value for the configuration in case of template.

Default value is an empty string.

Usage:

component.options.config_default = {"value": "test"}
config_html()

Return the HTML options used by the python and passed to the HTML.

Those options will not be available in the JavaScript layer and they are only defined either to build the HTML from Python or to set some HTML properties.

The returned dictionary is a copy so it can be changed or used in other processes. To change the internal component property, the options property should be used.

config_js(attrs: Optional[dict] = None)

Return the JavaScript options used by the builders functions.

Builder functions can be defined in the framework or external from the various packages.

The returned dictionary is a copy so it can be changed or used in other processes. To change the internal component property, the options property should be used.

Parameters:

attrs – Optional. The extra or overridden options

custom_config(name: str, value: Any, js_type: bool = False)

Add a custom JavaScript configuration.

Usage:

chart = page.ui.charts.apex.scatter()
chart.options.chart.zoom.custom_config("test", False)
Parameters:
  • name – The key to be added to the attributes

  • value – String or JString. The value of the defined attributes

  • js_type – Optional. Specify if the parameter is a JavaScript fragment

details()

Retrieve the defined properties details.

This function will return a dictionary with all the component attributes (required and optional) ones. It will provide the full available description of those components.

Usage:

but = page.ui.button()
pprint.pprint(but.options.details(), indent=4)
from_json(vals: dict, schema: Optional[dict] = None)

Load the option schema for a component from a json string.

TODO: add more feature to handle functions and enumeration

Parameters:
  • vals – The input schema

  • schema – The full object schema

has_attribute(cls_obj, name: Optional[str] = None)

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

  • name – The sub attribute name

isJsContent(property_name: str)

Check if the content of a property is defined to always be a JavaScript fragment.

Thus the framework will not convert it to a Json content.

Usage:

div = page.ui.div()
print(div.options.isJsContent("inline"))
Parameters:

property_name – The property name

property managed

Boolean flag to set if the component needs to be added to the page.

If set to False the component has to be managed manually in the page.

Usage:

but = page.ui.button()
but.options.managed = False
Prop bool:

Flag to specify if this component is automatically managed by the page

optional()

Return all options not added to the HTML component by default.

Those are options which will impact either the Python or the JavaScript builders.

To get the full definition of options the details method should be used.

Usage:

but = page.ui.button()
pprint.pprint(but.options.optional(), indent=4)
property profile

Boolean flag to set if extra logs need to be displayed.

This could help in debugging, default is the page verbose flag (default is false).

Usage:

but = page.ui.button()
but.options.verbose = True
Prop flag:

Flag to display / hide warning logs generated by the framework.

required()

Return all the mandatory / required options with the default values.

Those options are added by the framework to provide a default for the HTML components but they can be changed.

System options are also added to this category as they are always available in any HTML components.

To get the full definition of options the details method should be used.

Usage:

but = page.ui.button()
pprint.pprint(but.options.required(), indent=4)
set_attrs(vals: dict)

Set the object internal attributes.

Parameters:

vals – All the attributes to be added to the component

property style

Change some CSS attributes to the internal HTML component.

Related Pages:

Prop values:

The CSS attributes.

update_config(attrs: dict)

Update the option configuration.

Parameters:

attrs – The attributes to set

property verbose

Boolean flag to set if extra logs need to be displayed.

This could help in debugging, default is the page verbose flag (default is false).

Usage:

but = page.ui.button()
but.options.verbose = True
Prop flag:

Boolean. Flag to display / hide warning logs generated by the framework.

class epyk.core.html.options.OptTable.OptionsBasic(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property bordered

Add .table-bordered for borders on all sides of the table and cells.

Related Pages:

property colCssClasses
property hover

Add .table-hover to enable a hover state on table rows within a <tbody>.

Related Pages:

property responsive

Make the table responsive using Bootstrap class.

Related Pages:

property rowCssClasses
size(alias)

Add .table-sm to make any .table more compact by cutting all cell padding in half.

Related Pages:

property striped

Add the striped CSS class from Bootstrap.

Related Pages:

property with_header
property with_hover
class epyk.core.html.options.OptTable.OptionsPivot(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property aggregator

Constructor for an object which will aggregate results per cell (see documentation)

Related Pages:

property aggregatorName

Name of the aggregator, used for display purposes in some renderers.

Related Pages:

property colOrder

the order in which column data is provided to the renderer, must be one of “key_a_to_z”, “value_a_to_z”, “value_z_to_a”, ordering by value orders by column total

Related Pages:

property cols

Array of attribute names for use as columns.

Related Pages:

property dataClass

Constructor for the data class to be built and passed to the Renderer (should be a subclass of the default)

Related Pages:

property derivedAttributes

object to define derived attributes

Related Pages:

property filter

Called on each record, returns false if the record is to be excluded from the input before rendering or true otherwise

Related Pages:

property rendererOptions

Object passed through to renderer as options. See Renderers and Optional Extra Renderers for details.

Related Pages:

property rowOrder

The order in which row data is provided to the renderer, must be one of “key_a_to_z”, “value_a_to_z”, “value_z_to_a”, ordering by value orders by row total

Related Pages:

property rows

Array of attribute names to use as rows.

Related Pages:

property showUI

Show the drag and drop UI panel

Related Pages:

property sorters

accessed or called with an attribute name and can return a function which can be used as an argument to array.sort for output purposes. If no function is returned, the default sorting mechanism is a built-in “natural sort” implementation. Useful for sorting attributes like month names, see example 1 and example 2.

Related Pages:

class epyk.core.html.options.OptTable.OptionsPivotUI(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property autoSortUnusedAttrs

controls whether or not unused attributes are kept sorted in the UI.

Related Pages:

property exclusions

Object whose keys are attribute names and values are arrays of attribute values which denote records to exclude from rendering; used to prepopulate the filter menus that appear on double-click.

Related Pages:

property hiddenAttributes

Object whose keys are attribute names and values are arrays of attribute values which denote records to exclude from rendering; used to prepopulate the filter menus that appear on double-click.

Related Pages:

property hiddenFromAggregators

Contains attribute names to omit from the aggregator arguments dropdowns.

Related Pages:

property hiddenFromDragDrop

Contains attribute names to omit from the drag’n’drop portion of the UI.

Related Pages:

property inclusions

Object whose keys are attribute names and values are arrays of attribute values which denote records to include in rendering; used to prepopulate the filter menus that appear on double-click (overrides exclusions below).

Related Pages:

property menuLimit

maximum number of values to list in the double-click menu.

Related Pages:

property onRefresh

Called upon renderer refresh with an object representing the current UI settings (see example).

Related Pages:

property renderer

Related Pages:

https://github.com/nicolaskruchten/pivottable/wiki/Parameters

property rendererName

Related Pages:

https://github.com/nicolaskruchten/pivottable/wiki/Parameters

property rendererOptions

passed through to renderer as options. See Renderers and Optional Extra Renderers for details.

Related Pages:

property renderers

Related Pages:

https://github.com/nicolaskruchten/pivottable/wiki/Parameters

property unusedAttrsVertical

Controls whether or not unused attributes are shown vertically instead of the default which is horizontally. true means always vertical, false means always horizontal. If set to a number (as is the default) then if the attributes’ names’ combined length in characters exceeds the number then the attributes will be shown vertically.

Related Pages:

class epyk.core.html.options.OptTable.OptionsTableCell(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
align(alias)

Use the predefined bootstrap classes to align the cells content.

Related Pages:

property center

Use the predefined bootstrap classes to align the cells content.

Related Pages:

property cssClasses
margin(value, position='s')

Use the predefined bootstrap classes to align the cells content.

Related Pages:

padding(value, position='s')

Use the predefined bootstrap classes to align the cells content.

Related Pages:

position(alias)

Use the predefined bootstrap classes to align the cells content.

Related Pages:

class epyk.core.html.options.OptTable.OptionsTableRow(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property cssClasses