AshTable.Table (ash_table v0.1.0)

Generic sortable table component

Expects the following parameters as assigns:

  • id - necessary, as this is a stateful LiveView component
  • query - An Ash Query or Resource module
  • sort (optional) - a sort/0 specifying the initial sort direction
  • col columns
    • attribute - the field this column displays, used to sort
    • apply_sort - optional arity 2 function which takes query, direction as args
  • caption (optional)

Summary

Types

@type sort() :: {atom() | nil, :asc | :desc}

Functions

Link to this function

render(assigns)

Callback implementation for Phoenix.LiveComponent.render/1.

Link to this function

sort_class(column_key, arg)

Link to this function

sort_direction(column_key, sort)

Link to this function

sort_normalized_keys(keys)

Link to this function

toggle_direction(arg)