cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting a tooltip on a table row in an app

SjoerdB
Mentor

Hi,

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?

SjoerdB_1-1754898335038.png

 

Dynatrace Certified Professional | Dynatrace partner IctCoreBiz B.V.
3 REPLIES 3

dani_coll
Dynatrace Participant
Dynatrace Participant

Hi SjoerdB!

Which version of the logs app do you have? I'm taking a look at the app v1.14.0 and there is no button on my table

dani_coll_1-1754907563671.png



dani_coll_0-1754907453289.png

 



for me, it's the 1.13.0...

But... do you get a tooltip on the (long) values, showing you the complete record...

SjoerdB_0-1754912362282.png

because if so, then maybe this version either is using an input as field, or moved the button down to cell level to do a tooltip per individual cell..

 

Dynatrace Certified Professional | Dynatrace partner IctCoreBiz B.V.

dani_coll
Dynatrace Participant
Dynatrace Participant

Hi SjoerdB, apologies for the delay.

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.

 

dani_coll_1-1756368012257.png

 

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>
      );
    },
  },
];

 

Featured Posts