Skip to content

Passing a DOM node primitive to a column definition #167

Closed Answered by c-kirkeby
c-kirkeby asked this question in Q&A
Discussion options

You must be logged in to vote

I figured it out - you can chain a slot method off the render:

    table.column({
      accessor: "name",
      header: "Name",
      cell: ({ row, value }) =>
        createRender(DataTableLink, {
          href: `/items/${row.id}`,
        }).slot(value ?? ""),
    }),

If anybody knows how to achieve it without the custom component, that would be awesome, but this solves my problem for now.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@bryanmylee
Comment options

@c-kirkeby
Comment options

Answer selected by c-kirkeby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants