I would like to get a tooltip on a table row in my app, however the tooltip is only meant for buttons and inputs, not for table elements.
If I look at e.g. the delivered “Logs” app, I see a button is used for the complete row. What construct is used here, how could I mimic this in my app?
Looks like version 1.14.0 of Logs app onwards is using a newer version of Strato where the DataTableV2 does not have the button element as a child of the row anymore, now they are controlling the interactivity of the row within the row element.
Unfortunately, there is no way to have a tooltip on the row level. Only on the cell level do we allow custom-rendered cells, configured by column definition:
const columnsWithCustomCell: DataTableV2ColumnDef<(typeof data)[number]>[] = [
{
header: 'FirstName',
id: 'firstname',
accessor: 'firstname',
width: 'auto',
},
{
header: 'LastName',
id: 'lastname',
accessor: 'lastname',
width: 'auto',
cell: ({ value, rowId }) => {. =========================== HERE =============================
return (
<DataTableV2.DefaultCell>
<TerminologyOverlay>
<TerminologyOverlay.Trigger>{value}</TerminologyOverlay.Trigger>
<TerminologyOverlay.Description>
<div
onClick={() =>
console.log(`clicked description of cell in row "${rowId}"`)
}
>
{`This is a description of cell in row "${rowId}".`}
</div>
</TerminologyOverlay.Description>
</TerminologyOverlay>
</DataTableV2.DefaultCell>
);
},
},
];
Hi @raymond_shanley , that is actually what I did in the end, make sure for long fields to use `textOverflow: “ellipsis”`, and add my complete story that I wanted to show in an expandable row.