MishkaGervaz.Table.Types.Action.Accordion (MishkaGervaz v0.0.1-alpha.2)

Copy Markdown View Source

Accordion action type - renders an expand/collapse button for row details.

Fires the "expand_row" event directly on the table component, which triggers the internal expand state management (setting expanded_id, expanded_data) and sends {:expand_row, id} to the parent LiveView for async content loading.

Usage

row_actions do
  action :expand, type: :accordion
end

The parent LiveView handles {:expand_row, id} to load data, then sends the rendered HTML back via:

send_update(MishkaGervaz.Table.Web.Live,
  id: "my-table",
  expanded_html: html
)

See MishkaGervaz.Table.Types.Action (registry), MishkaGervaz.Table.Behaviours.ActionType, MishkaGervaz.Table.Entities.RowAction, and MishkaGervaz.Table.Entities.BulkAction.