#Render multiple cols in one cell

2 messages · Page 1 of 1 (latest)

thick moth
#

What if i dont want to render 2 diff columns 'name' and 'phone' but wanna render a single column with a cell like <div>{name}<br />{phone}? How can i get the both values for the cell?

lyric trail
#

two ways that both seem like kind of the same thing

colHelper.accessor('name', {
  cell: (info) => {
    const provider = info.getValue()
    if (info.row.original.providerType !== 'saml') return provider
    return (
      <LinkCell to={pb.samlIdp({ ...siloSelector, provider })}>{provider}</LinkCell>
    )
  },
}),
colHelper.accessor((row) => ({ name: row.name, providerType: row.providerType }), {
  header: 'name',
  cell: (info) => {
    const { name: provider, providerType } = info.getValue()
    if (providerType !== 'saml') return provider
    return (
      <LinkCell to={pb.samlIdp({ ...siloSelector, provider })}>{provider}</LinkCell>
    )
  },
}),