Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 437 #441

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions apps/www/src/content/components/data-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ Next, we'll enable the `addSelectedRows` plugin and import the `<Checkbox />` co

To accommodate the checkbox, we'll need to update our table styles. We'll also add a message to show how many rows are selected.

```svelte showLineNumbers title="routes/payments/data-table.svelte" {39,65,87-90}
```svelte showLineNumbers title="routes/payments/data-table.svelte" {39,62-65,90-93}
<div>
<div class="flex items-center py-4">
<Input
Expand Down Expand Up @@ -1393,7 +1393,10 @@ To accommodate the checkbox, we'll need to update our table styles. We'll also a
<Table.Body {...$tableBodyAttrs}>
{#each $pageRows as row (row.id)}
<Subscribe rowAttrs={row.attrs()} let:rowAttrs>
<Table.Row {...rowAttrs}>
<Table.Row
{...rowAttrs}
data-state={$selectedDataIds[row.id] && "selected"}
>
{#each row.cells as cell (cell.id)}
<Subscribe attrs={cell.attrs()} let:attrs>
<Table.Cell {...attrs} class="[&:has([role=checkbox])]:pl-3">
Expand Down