ag-grid中的“行ID = [对象对象]”,重复的节点ID问题

时间:2019-05-09 12:24:25

标签: ag-grid ag-grid-react

我在控制台中收到警告,因为{-{1}}在ag-grid中。

  

ag-grid:从中检测到重复的节点ID'[object Object]'   getRowNodeId回调,这可能会导致网格问题。

有什么办法解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

您需要使用getRowNodeId属性。您可能提供了不合适的内容。

参考样本:Adding the Data Table

        <AgGridReact
            // provide column definitions
            columnDefs={this.colDefs}
            // row data provided via props from the file store
            rowData={this.props.files}
            // return id required for delta updates
            getRowNodeId={data => data.id}>
        </AgGridReact>

文档参考:Grid callbacks

  

getRowNodeId(data): :允许您根据数据设置特定行节点的ID。对于分页和虚拟分页的选择以及服务器端排序和过滤很有用。

相关问题