DataTable (data_table v0.1.0)
Summary
Functions
Callback implementation for Phoenix.LiveComponent.handle_event/3
.
Attributes
id
(:any
) (required) -live_data_table
is a stateful component, and requires anid
. SeeLiveView.LiveComponent
for more information.
Callback implementation for Phoenix.LiveComponent.mount/1
.
Callback implementation for Phoenix.LiveComponent.render/1
.
Callback implementation for Phoenix.LiveComponent.update/2
.
Functions
assign_render_data(socket)
assigns_to_spec(assigns)
do_query(socket)
field_by_str_id(str_id, spec)
handle_event(binary, params, socket)
Callback implementation for Phoenix.LiveComponent.handle_event/3
.
id_to_string(id)
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 anid
. SeeLiveView.LiveComponent
for more information.source
(:any
) (required) - .nav
(:any
) - Override the navigation state of the table. Most likely only present whenhandle_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 thenav
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 offield
s 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 infields
.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 infields
.
row_expanded
- Markup which will be rendered when a row is expanded. Accepts attributes:fields
(:list
) - List offield
s 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 offield
s that will be queried when this field is visible.
selection_action
- Accepts attributes:label
(:string
) (required)handle_action
(:any
) (required)
mount(socket)
Callback implementation for Phoenix.LiveComponent.mount/1
.
render(assigns)
Callback implementation for Phoenix.LiveComponent.render/1
.
update(assigns, socket)
Callback implementation for Phoenix.LiveComponent.update/2
.