干锅设置组件

时间:2019-06-26 19:16:00

标签: settings customization griddle

我正在使用Griddle-React v1.13.1。在此版本中,设置组件具有“可见”和“隐藏”列部分。我想使此版本的Griddle像以前在版本0中一样工作-在该版本中,所有列都一起列出,并且在单击以指示它们是否可见时会更改颜色。我尝试编写一个自定义设置组件,但无法重新渲染该表。我还注意到,在文档中有一条评论“正在提供有关如何设置SettingsComponents的更多文档”-但我认为它从未添加。

有人知道如何自定义设置组件吗?或者您可以向我介绍网格设置自定义的示例吗?

我尝试覆盖Component设置

render(){     const NewSettings =({settingsComponents,style,classname})=> {       返回(                    {this.state.columns.map((col,idx)=> {             返回(                this.toggleColumn(idx)}                 className = {'settings-label'+(!col.visible?'invisible':'')}                 key = {idx}>                 {col.label}               )           })           }                )     }

const tableData = this.unpackData(this.props.data)

if (!this.props.data) return (<div>No Installs Found</div>)
return (
  <div id='installs-table-container' data-test='contacts-table-container'>
    <div>{'Found: ' + this.props.data.length + ' Installs'}</div>
    <Griddle
      data={tableData}
      plugins={[plugins.LocalPlugin]}
      components={{
        Settings: NewSettings
      }}
    >
      <RowDefinition>
        {this.getColumns()}
      </RowDefinition>
    </Griddle>
  </div>
)

}

使用这种方法,表格表不会更新。我正在寻找一种可行的方法。

0 个答案:

没有答案