Display data as html icon and alter background color #3861
-
Hello! I would like to alter way cells are being displayed in a certain column and I have not found a great method for accomplishing this. This is how I am currently displaying the data: And this is how I would like to alter it: <ReactTable Any help is greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This can be closed! I solved the issue by creating a function to handle background color and displaying the icon rather than the data and passed it in my columns as the accessor -- this solution only worked for me because I did not need to filter the data by my "Stat" column. Function to handle changes: function CarrierStat(sidebarResults) { Small change to columns object: { |
Beta Was this translation helpful? Give feedback.
This can be closed! I solved the issue by creating a function to handle background color and displaying the icon rather than the data and passed it in my columns as the accessor -- this solution only worked for me because I did not need to filter the data by my "Stat" column.
Function to handle changes:
function CarrierStat(sidebarResults) {
if (
sidebarResults.stat == "Carrier Claim" ||
sidebarResults.stat == "On Hold" ||
sidebarResults.stat == "Do Not Load" ||
sidebarResults.stat == "Authority Inactive" ||
sidebarResults.stat == "Authority Date" ||
sidebarResults.stat == "Out Of Service"
) {
return (
<div
onClick={() => testFunc(sidebarResults.stat)}
style={{ width: "100%", backgroundCo…