23 Aug 2023 08:18 PM
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?
Solved! Go to Solution.
28 Aug 2023 09:19 PM
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.