MishkaGervaz.Table.Types.Action.RowClick (MishkaGervaz v0.0.1-alpha.3)

Copy Markdown View Source

Row click action type - makes the entire row clickable.

Unlike button-based actions, row_click applies to the entire table row. It can navigate to a path or emit an event when the row is clicked.

Usage

row_actions do
  action :view, type: :row_click, path: "/posts/{id}"
end

Or with a custom event:

row_actions do
  action :select, type: :row_click, event: :row_selected
end

The action is not rendered as a button - instead, it's used by the template to make rows clickable.

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

Summary

Functions

Build the click handler data for a row.

Functions

build_click_handler(action, record)

@spec build_click_handler(
  map(),
  struct()
) :: map()

Build the click handler data for a row.

Returns a map with :navigate or :event that templates can use to make the row clickable.