feat: add col_click attribute to table component for checkbox column
- Add col_click slot attribute to table component that overrides row_click - Clicking anywhere in the checkbox column now toggles the checkbox - Clicking other columns still navigates to member details Closes #223
This commit is contained in:
parent
09c75212b2
commit
8e4f1ba674
6 changed files with 71 additions and 60 deletions
|
|
@ -892,6 +892,16 @@ defmodule MvWeb.MemberLive.Index do
|
|||
|> Enum.map(&format_member_email/1)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns a JS command to toggle member selection when clicking the checkbox column.
|
||||
|
||||
Used as `col_click` handler to ensure clicking anywhere in the checkbox column
|
||||
toggles the checkbox instead of navigating to the member details.
|
||||
"""
|
||||
def checkbox_column_click(member) do
|
||||
JS.push("select_member", value: %{id: member.id})
|
||||
end
|
||||
|
||||
# Formats a member's email in the format "First Last <email>"
|
||||
# Used for copy_emails feature and mailto links to create email-client-friendly format.
|
||||
def format_member_email(member) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue