Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Selection #24

Closed
zfranco55 opened this issue Mar 15, 2021 · 2 comments
Closed

Selection #24

zfranco55 opened this issue Mar 15, 2021 · 2 comments

Comments

@zfranco55
Copy link

is it possible to select a row and perform actions, and change alternate colors of the rows?

@vincjo
Copy link
Owner

vincjo commented Jul 27, 2021

It's entirely possible. You can add a click event in and do what you want

You can also change the row color, for example using css classes

@vincjo vincjo closed this as completed Jul 27, 2021
@PlopTheReal
Copy link

@zfranco55 how did you handled the selection?
With such code:

...
  {#each $rows as row}
                <tr>
                    <td
                        ><input
                            type="checkbox"
                            checked={row._selected || false}
                            on:change={(e) => {
                                row._selected = !row._selected || true;
                           
                           }}
                        /></td
                    >
                    <td>{row.email}</td>
                    <td>{row.visits}</td>
                </tr>
            {/each}
...

it's raising the following error that I don't understand:

Uncaught TypeError: store.set is not a function
    at set_store_value (index.mjs:151:11)
    at Array.change_handler (AdminCustomers.svelte:161:42)
    at HTMLInputElement.change_handler (AdminCustomers.svelte:168:36)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants