Skip to content

Commit

Permalink
fix(tablevis): update datatable change
Browse files Browse the repository at this point in the history
  • Loading branch information
Conglei Shi authored and zhaoyongjie committed Nov 26, 2021
1 parent d093920 commit 02b9772
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export const getRenderer = ({
isSelected: (cell: Cell) => boolean;
handleCellSelected: (cell: Cell) => any;
}) => (props: RendererProps) => {
const { key } = props;
const value = props.row.rowData.data[key];
const { keyName } = props;
const value = props.row.rowData.data[keyName];
const isMetric = column.type === 'metric';
let Parent;

Expand All @@ -68,7 +68,8 @@ export const getRenderer = ({
const color = colorPositiveNegative && value < 0 ? NEGATIVE_COLOR : POSITIVE_COLOR;
Parent = ({ children }: { children: React.ReactNode }) => {
const boxStyle: CSSProperties = {
backgroundColor: enableFilter && isSelected({ key, value }) ? SELECTION_COLOR : undefined,
backgroundColor:
enableFilter && isSelected({ key: keyName, value }) ? SELECTION_COLOR : undefined,
margin: '0px -16px',
};
const boxContainerStyle: CSSProperties = {
Expand Down Expand Up @@ -105,7 +106,7 @@ export const getRenderer = ({
return (
<div
onClick={handleCellSelected({
key,
key: keyName,
value,
})}
>
Expand Down

0 comments on commit 02b9772

Please sign in to comment.