SelectoComponents.EnhancedTable.Sorting (selecto_components v0.4.5)
Provides sorting functionality for SelectoComponents tables. Supports single and multi-column sorting with visual indicators.
Link to this section Summary
Functions
Apply sorting to Selecto query. Column-based sorting takes priority over query-based sorting.
Deserialize sort state from URL or storage.
Get sort indicator for a column. Returns :asc, :desc, or nil
Get sort position for multi-column sorting. Returns the position number or nil.
Handle sort column click event.
Initialize sort state in the socket assigns.
Serialize sort state for URL or storage.
Render sort indicator component.
Render sortable column header.
Link to this section Functions
apply_sort_to_query(selecto, sort_by)
Apply sorting to Selecto query. Column-based sorting takes priority over query-based sorting.
deserialize_sort(sort_data)
Deserialize sort state from URL or storage.
get_sort_indicator(column, sort_by)
Get sort indicator for a column. Returns :asc, :desc, or nil
get_sort_position(column, sort_by)
Get sort position for multi-column sorting. Returns the position number or nil.
handle_sort_click(column, socket, multi \\ false)
Handle sort column click event.
parameters
Parameters
- column: The column identifier to sort by
- socket: The LiveView socket
- multi: Boolean indicating if multi-column sort (shift-click)
init_sort_state(socket)
Initialize sort state in the socket assigns.
serialize_sort(sort_by)
Serialize sort state for URL or storage.
sort_indicator(assigns)
Render sort indicator component.
sortable_header(assigns)
Render sortable column header.