DataTable (data_table v0.1.0)

Summary

Functions

Attributes

  • id (:any) (required) - live_data_table is a stateful component, and requires an id. See LiveView.LiveComponent for more information.

Callback implementation for Phoenix.LiveComponent.mount/1.

Callback implementation for Phoenix.LiveComponent.render/1.

Functions

Link to this function

assign_render_data(socket)

Link to this function

assigns_to_spec(assigns)

Link to this function

do_query(socket)

Link to this function

field_by_str_id(str_id, spec)

Link to this function

handle_event(binary, params, socket)

Callback implementation for Phoenix.LiveComponent.handle_event/3.

Link to this function

id_to_string(id)

Link to this function

live_data_table(assigns)

@spec live_data_table(assigns :: Socket.assigns()) :: Phoenix.LiveView.Rendered.t()

Attributes

  • id (:any) (required) - live_data_table is a stateful component, and requires an id. See LiveView.LiveComponent for more information.

  • source (:any) (required) - .

  • nav (:any) - Override the navigation state of the table. Most likely only present when handle_nav is also present.

    nil will be counted as no change.

  • handle_nav (:any) - Called when the navigation state of the table has changed. If present, the navigation data should be passed back into the nav parameter.

  • always_columns (:list) - A list of column ids that will always be loaded.

Slots

  • col - One :col should be sepecified for each potential column in the table. Accepts attributes:

    • name (:string) (required) - Name in column header. Must be unique.

    • visible (:boolean) - Default visibility of the column.

    • fields (:list) - List of fields that will be queried when this field is visible.

    • filter_field (:atom) - If present, cells will have a filter shortcut. The filter shortcut will apply a filter for the specified field. Defaults to the first field in fields.

    • filter_field_op (:atom) - The filter op type which will be used for the cell filter shortcut.

    • sort_field (:atom) - If present, columns will be sortable. The sort will occur on the specified field. Defaults to the first field in fields.

  • row_expanded - Markup which will be rendered when a row is expanded. Accepts attributes:

    • fields (:list) - List of fields that will be queried when a row is expanded.
  • top_right - Markup in the top right corner of the table.

  • row_buttons - Markup in the rightmost side of each row in the table. Accepts attributes:

    • fields (:list) - List of fields that will be queried when this field is visible.
  • selection_action - Accepts attributes:

    • label (:string) (required)
    • handle_action (:any) (required)

Callback implementation for Phoenix.LiveComponent.mount/1.

Link to this function

render(assigns)

Callback implementation for Phoenix.LiveComponent.render/1.

Link to this function

update(assigns, socket)

Callback implementation for Phoenix.LiveComponent.update/2.