Enable row selection

To enable row selection, rows must have at least a unique id field. This unique id must be defined in TableHandler params:

const table = new TableHandler(data, { selectBy: 'id' })

Select a row

  • Is row selected ? table.selected.includes(id)
  • Select a row: table.select(id)
{#each table.rows as row}
    <tr class:active={table.selected.includes(row.id)}>
        <td>
            <input type="checkbox" 
                checked={table.selected.includes(row.id)}
                onclick={() => table.select(row.id)}
            >
        </td>
    </tr>
{/each}
id
first_name
last_name
1TobieVint
2ZachariasCerman
3GériannaBunn
4BeeSaurin
5MéyèreGranulette
6FrederichBenley
7BeckiCriag
8NicholsRisom
9RonMenendes
10ThaneGammill