HtmlTrees Module

class epyk.core.html.HtmlTrees.DropDown(page: PageModel, data: list, text: Optional[str], width: tuple, height: tuple, html_code: Optional[str], helper: str, options: Optional[dict], profile: Optional[Union[bool, dict]])
click(js_funcs: Union[list, str], profile: Optional[Union[bool, dict]] = None, source_event: Optional[str] = None, on_ready: bool = False)

The onclick event occurs when the user clicks on an element.

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 options: OptDropDown

Property to set all the possible object for a DropDown.

property style: ClassDropDown

The Javascript functions defined for this component.

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

class epyk.core.html.HtmlTrees.Tree(page: PageModel, records: list, width: tuple, height: tuple, html_code: Optional[str], helper: Optional[str], options: Optional[dict], profile: Optional[Union[bool, dict]])
click(js_funcs: Union[list, str], profile: Optional[Union[bool, dict]] = None, source_event: Optional[str] = None, on_ready: bool = False)
Parameters:
  • js_funcs – The 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

click_node(js_funcs: Union[list, str], profile: Optional[Union[bool, dict]] = None)
Parameters:
  • js_funcs – The Javascript functions.

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

property dom: JsHtmlTree

Return all the Javascript functions defined for an HTML Component.

Those functions will use plain javascript by default.

Returns:

A Javascript Dom object

loading(status: bool = True, color: Optional[str] = None, loading: str = 'Loading....', z_index: int = 500)
Parameters:
  • status

  • color

  • loading

  • z_index

property options: OptionsTree

Property to the component options.

Options can either impact the Python side or the Javascript builder.

Python can pass some options to the JavaScript layer.

remote(method: str, url: Union[str, JsDataModel], data: Optional[dict] = None, js_code: str = 'treeRemoveRest', is_json: bool = True, components: Optional[List[Union[Tuple[HtmlModel, str], HtmlModel]]] = None, profile: Optional[Union[bool, dict]] = None, headers: Optional[dict] = None, stringify: bool = True, js_func_name: Optional[str] = None, always: bool = False)

Get data from a remote service and update the tree.

Parameters:
  • url – The url path of the HTTP request

  • method – The REST method used

  • data – Optional. Corresponding to a JavaScript object

  • js_code – Optional. The variable name created in the Javascript (default response)

  • is_json – Optional. Specify the type of object passed

  • components – Optional. This will add the component value to the request object

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

  • headers – Optional. The request headers

  • stringify – Optional. Stringify the request data for json exchange

  • js_func_name – Optional. The post process for the data returned by the remote service

  • always – Optional. If true force the tree to always call the remote server

class epyk.core.html.HtmlTrees.TreeInput(page: PageModel, records: list, width: tuple, height: tuple, html_code: Optional[str], helper: Optional[str], options: Optional[dict], profile: Optional[Union[bool, dict]])
set(ul, data: list)
Parameters:
  • ul

  • data (list) –