tables module

class EditingTable(label, inputs, states, get_data_func, update_table_func=None, output=None, output_varselector_name=None, number_format=None, **kwargs)

Bases: object

A reusable and flexible Dash component for editing tabular data.

This component renders a Dash AgGrid table where the data is retrieved using a get_data function that takes *inputs and *states as *args. Optionally it can output clicked column values to the variable selector or update data using the dash ag grid attribute ‘CellValueChanged’

Parameters:
  • label (str)

  • inputs (list[str])

  • states (list[str])

  • get_data_func (Callable[[...], Any])

  • update_table_func (Callable[[...], Any] | None)

  • output (str | list[str] | None)

  • output_varselector_name (str | list[str] | None)

  • number_format (str | None)

  • kwargs (Any)

layout()

Returns the layout for the EditingTable module.

Because this module can be used as a a component in other modules, it needs to have a layout method that is not abstract. For implementations as tab or window, this method should still be overridden.

Returns:

A Dash HTML Div component representing the layout of the module to be displayed directly.

Return type:

html.Div

module_callbacks()

Register Dash callbacks for the component.

Defines callback chains for: - Loading data into AgGrid (load_to_table). - Capturing edits and opening the modal (capture_edit). - Confirming edits (logging + updating table data) (confirm_edit). - Cancelling edits (reverting table to saved state) (cancel_edit).

Return type:

None

class EditingTableTab(label, inputs, states, get_data_func, update_table_func=None, output=None, output_varselector_name=None, number_format=None, **kwargs)

Bases: TabImplementation, EditingTable

EditingTable embedded in a tab container.

Parameters:
  • label (str)

  • inputs (list[str])

  • states (list[str])

  • get_data_func (Callable[[...], Any])

  • update_table_func (Callable[[...], Any] | None)

  • output (str | None)

  • output_varselector_name (str | None)

  • number_format (str | None)

  • kwargs (Any)

class EditingTableWindow(label, inputs, states, get_data_func, update_table_func=None, output=None, output_varselector_name=None, number_format=None, **kwargs)

Bases: WindowImplementation, EditingTable

A class to implement an EditingTable module inside a modal.

Parameters:
  • label (str)

  • inputs (list[str])

  • states (list[str])

  • get_data_func (Callable[[...], Any])

  • update_table_func (Callable[[...], Any] | None)

  • output (str | None)

  • output_varselector_name (str | None)

  • number_format (str | None)

  • kwargs (Any)