pass component or html element to header/cell on svelte-table #4630
Unanswered
sharmapukar217
asked this question in
General
Replies: 1 comment 1 reply
-
I found the answer in this issue: #3971 There is a Just pass the desired Svelte component and an object with the props: const defaultColumns: ColumnDef<Invoice>[] = [
// ...
{
header: 'Mail Receipt',
cell: (info) => renderComponent(SendMailBtn, { id: info.row.id })
}
] The <script lang="ts">
export let id: number;
function sendEmail() {
console.log(id);
/* do your magic here */
}
</script>
<button class="button" on:click={sendEmail}>📧</button> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to render some html instead of plain text on header and cell with svelte but i could'nt find any way. Is there any solution available
Beta Was this translation helpful? Give feedback.
All reactions