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

DataTable rowThreshold in array

lucas_hocker
Dynatrace Advisor
Dynatrace Advisor

I have two arrays, `haystack` and `needles` and I'd like to use DataTable rowThresholds to highlight the rows of `haystack` that are also in `needles`. I don't see a straight-forward way of doing this with the available comparators. Do I need to create a new field in `haystack` based on the in comparison between arrays?

1 REPLY 1

imsingh
Dynatrace Advisor
Dynatrace Advisor

Hi Lukas,

You're correct that using rowThresholds to highlight a row using custom logic isn't possible. I think easiest way to achieve what you want is exactly what you mentioned, "Create a new field in haystack" and store a boolean value in it. 

Also, since the available comparators only work with number or string. You actually have to convert boolean to strings and store "true" or "false" and use it in the comparison as following:

<DataTable
        columns={sampleColumns}
        data={sampleData}
        fullWidth
        rowThresholds={[
          {
            id: "inHeystack",
            value: "true",
            comparator: "equal-to",
            color: Colors.Charts.Loglevel.Critical.Default,
          },
        ]}
      />

 

I'll dig deeper and let you know if I find more details.

 

Featured Posts