Reactjs 如何在react数据网格中禁用默认标题
react数据网格对每个单元格都有默认的工具提示。它会自动添加title属性。我不想要那个工具提示,我怎么能隐藏它 而且,我不想使用。我想它会在头顶上 e、 g 请在此处查看有关Kristin的不需要的工具提示Reactjs 如何在react数据网格中禁用默认标题,reactjs,react-data-grid,Reactjs,React Data Grid,react数据网格对每个单元格都有默认的工具提示。它会自动添加title属性。我不想要那个工具提示,我怎么能隐藏它 而且,我不想使用。我想它会在头顶上 e、 g 请在此处查看有关Kristin的不需要的工具提示 如果没有自定义的格式化程序,可能无法四处走动 至于开销,请查看它使用的实现SimpleCellFormatter 那里没有什么特别的事情 class SimpleCellFormatter extends React.Component { static propTypes = {
如果没有自定义的
格式化程序,可能无法四处走动
至于开销,请查看它使用的实现SimpleCellFormatter
那里没有什么特别的事情
class SimpleCellFormatter extends React.Component {
static propTypes = {
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object, PropTypes.bool])
};
shouldComponentUpdate(nextProps) {
return nextProps.value !== this.props.value;
}
render() {
return <div title={this.props.value}>{this.props.value}</div>;
}
}
并将其附加到您的列中
const columns = [
{
key: "id",
name: "ID",
sortDescendingFirst: true
},
{
key: "title",
name: "Title",
title: false
},
{
key: "firstName",
name: "First Name",
formatter: CustomSimpleCellFormatter,
},
...
希望有帮助
const columns = [
{
key: "id",
name: "ID",
sortDescendingFirst: true
},
{
key: "title",
name: "Title",
title: false
},
{
key: "firstName",
name: "First Name",
formatter: CustomSimpleCellFormatter,
},
...