Open risalfajar opened 1 year ago
Could you add an event handler on your <tr/>
element?
If not, you would have to write a custom plugin to do so.
Yes currently it's possible to implement this
{#each $rows as row (row.id)}
<Subscribe rowAttrs={row.attrs()} let:rowAttrs>
<tr {...rowAttrs} class:clickable on:click={() => dispatch('click', row.original)}>
{#each row.cells as cell (cell.id)}
<Subscribe attrs={cell.attrs()} let:attrs>
<td {...attrs}>
<Render of={cell.render()}/>
</td>
</Subscribe>
{/each}
</tr>
</Subscribe>
{/each}
But maybe having a plugin to do this is a nice to have.
Yeah it would be nice to have a plugin to attach listeners to table elements. I'll look into it!
Hey! is it possible to add simple way to pass an ID for Navigating Purposes?
Also, row.original
seems to have an issue with types.
Hey @fstodulski, take a look at https://github.com/bryanmylee/svelte-headless-table/issues/31#issuecomment-1167195138.
I've resolved my type issues with row.original
with it.
Is any plugin to add click event to each row with its corresponding data as argument?