HtmlRadio Module

class epyk.core.html.HtmlRadio.Radio(page: PageModel, vals: List[dict], html_code: Optional[str], group_name: Optional[str], width: tuple, height: tuple, options: Optional[dict], profile: Optional[Union[bool, dict]])
add(val: Union[Html, str], checked: bool = False)

Add a value to the radio component.

Parameters:
  • val – The item to be added

  • checked – Optional. Check the item

property dom: Radio

HTML Dom object.

set_checked(text: str)
Parameters:

text – The item value to set as checked

set_disable(text: str)
Parameters:

text – The item value to disable

class epyk.core.html.HtmlRadio.Switch(page: PageModel, records: dict, color: str, width: Optional[Union[tuple, int, str]], height: Optional[Union[tuple, int, str]], html_code: str, options: dict, profile: Optional[Union[bool, dict]])
click(js_funcs: Union[List[Union[str, JsDataModel]], str], profile: Optional[Union[bool, dict]] = None, source_event: Optional[str] = None, on_ready: bool = False)

Add click event to the switch component.

Usage:

mode_switch = page.ui.fields.toggle({"off": 'hidden', "on": "visible"}, is_on=True, label="", htmlCode="switch")
mode_switch.input.click([
  page.js.console.log(mode_switch.input.dom.val)
])
Parameters:
  • js_funcs – A Javascript Python function

  • profile – Optional. Set to true to get the profile for the function on the Javascript console

  • source_event – Optional. The source target for the event

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

property dom: JsHtmlSwitch

Return all the Javascript functions defined for an HTML Component.

Those functions will use plain javascript available for a DOM element by default.

event_fnc(event: str)

Function to get the generated JavaScript method in order to then reuse it in other components.

This will return the event function in a string already transpiled.

Parameters:

event – The event function.

property js: Switch

The Javascript functions defined for this component.

Those can be specific ones for the module or generic ones from the language.

Returns:

A Javascript Dom object.

property off

Change the value displayed when switch off

property on

Change the value displayed when switch on

toggle(on_funcs: Optional[Union[List[Union[str, JsDataModel]], str]] = None, off_funcs: Optional[Union[List[Union[str, JsDataModel]], str]] = None, profile: Optional[Union[bool, dict]] = None, on_ready: bool = False)

Set the click property for the Switch.

The toggle event allow specifying different Javascript functions for each states of the component.

Usage:

sw = page.ui.buttons.switch({'on': "true", 'off': 'false'})
sw.toggle([
  page.js.console.log(sw.content)
])
Parameters:
  • on_funcs – Optional. The Javascript functions

  • off_funcs – Optional. The Javascript functions

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

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

class epyk.core.html.HtmlRadio.Tick(page: PageModel, position: str, icon: str, text: str, tooltip: str, width: tuple, height: tuple, html_code: str, options: Optional[dict], profile: Optional[Union[bool, dict]])
property dom: Tick

HTML Dom object.