From 9aedae213384693020ffd0362f74619d8a2f5ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Lo=CC=81pez=20Guevara?= Date: Tue, 7 Nov 2023 20:09:36 -0300 Subject: [PATCH] fix(examples/tasks): add click handler --- .../tasks/(components)/data-table.svelte | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/apps/www/src/routes/examples/tasks/(components)/data-table.svelte b/apps/www/src/routes/examples/tasks/(components)/data-table.svelte index 34beccc32..3c0a9ffc6 100644 --- a/apps/www/src/routes/examples/tasks/(components)/data-table.svelte +++ b/apps/www/src/routes/examples/tasks/(components)/data-table.svelte @@ -227,7 +227,7 @@ tableAttrs, tableBodyAttrs, pluginStates: { - custom: { sidebar, taskIdOnEdition, taskOnEdition } + custom: { sidebar, taskIdOnEdition } } } = tableModel; @@ -239,6 +239,12 @@ (!$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); + }
@@ -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 + )} >