Skip to content

Commit

Permalink
fix(examples/tasks): add click handler
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandolguevara committed Nov 7, 2023
1 parent e5375d6 commit 336f8d0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
} = pluginStates.colFilter;
</script>

<aside class="relative col-span-2 border-r border-b p-2">
<aside class="col-span-2 border-r border-b p-2">
<div class="sticky top-12">
<div class="flex flex-col space-y-2">
<span class="text-sm font-medium">Filters</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
);
</script>

<aside class="relative col-span-3 border-l border-b p-2">
<aside class="col-span-3 border-l border-b p-2">
<div class="sticky top-12 flex flex-col h-full">
<Card.Header>
<Card.Title># {task.id}</Card.Title>
Expand Down
23 changes: 13 additions & 10 deletions apps/www/src/routes/examples/tasks/(components)/data-table.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
tableAttrs,
tableBodyAttrs,
pluginStates: {
custom: { sidebar, taskIdOnEdition, taskOnEdition }
custom: { sidebar, taskIdOnEdition }
}
} = tableModel;
Expand All @@ -239,11 +239,17 @@
(!$anySidebarVisible
? 0
: ($leftSidebarVisible ? 2 : 0) + ($rightSidebarVisible ? 3 : 0));
/* eslint-disable @typescript-eslint/no-explicit-any */
function taskCellClicked(row: any) {
const cells = row.cellForId;
taskIdOnEdition.set(cells.task.value);
}
</script>

<div class="relative rounded-md border">
<div class="rounded-md border">
<DataTableToolbar {tableModel} />
<div class="relative grid grid-cols-{cols}">
<div class="grid grid-cols-{cols}">
{#if $leftSidebarVisible}
<DataTableFilterLeftSidebar {tableModel} />
{/if}
Expand Down Expand Up @@ -299,13 +305,10 @@
variant="link"
size="sm"
class="underline"
on:click={() => {
const cells =
row.cellForId;
taskIdOnEdition.set(
cells.task.value
);
}}
on:click={() =>
taskCellClicked(
row
)}
>
<Render
of={cell.render()}
Expand Down

0 comments on commit 336f8d0

Please sign in to comment.