我一直试图让这个工作一段时间,但我一直没有想出任何东西。fixed-data-table-2 具有用于行 css 的内置功能,但最终被单个单元 css 和包装器覆盖。我一直在做这方面的研究,但我无法提出解决方案。任何帮助将非常感激。
这是我当前的代码,请告诉我需要更改的内容!
import s from './styles.css';
const FilteredCell = function({ data, rowIndex, columnKey, ...props }) {
let output = data[rowIndex][columnKey];
return <Cell {...props}>{output}</Cell>;
};
const rowClassName = () => s.row;
return(
<Table
height={filteredData.length * 30 + 60}
rowsCount={filteredData.length}
rowHeight={30}
width={800}
headerHeight={50}
onRowClick={this.rowClicked}
rowClassNameGetter={rowClassName}
>
<Column
columnKey="chromosome"
width={100}
header={<Cell>Chromosome</Cell>}
cell={<FilteredCell data={filteredData} />}
/>
<Column
columnKey="position"
width={200}
header={<Cell>Position</Cell>}
cell={<FilteredCell data={filteredData} />}
/>
<Column
columnKey="rsid"
width={150}
header={<Cell>RSID</Cell>}
cell={<FilteredCell data={filteredData} />}
/>
<Column
columnKey="gene"
width={100}
header={<Cell>Gene</Cell>}
cell={<FilteredCell data={filteredData} />}
/>
<Column
columnKey="ref_allele"
width={100}
header={<Cell>Reference Allele</Cell>}
cell={<FilteredCell data={filteredData} />}
/>
<Column
columnKey="alt_allele"
width={100}
header={<Cell>Alternative Allele</Cell>}
cell={<FilteredCell data={filteredData} />}
/>
</Table>
)
下面是我当前的 css
.row:hover {
cursor: pointer;
background-color: yellow:
}
我一直在尝试使用我发现的一些建议
.public_fixedDataTable_bodyRow:hover .public_fixedDataTableCell_main
但它似乎没有工作或做任何事情。我不确定现在如何准确加载它。我导出组件的方式是
export default connect(select)(withStyles(s)(ExpectoSnpTable));