【发布时间】:2020-03-15 09:28:55
【问题描述】:
我正在为我的 react 应用程序使用数据网格 (https://js.devexpress.com/)。我能够定义列,使用列选择器添加-删除它们。但我需要使用 setState 添加-删除(或显示/隐藏)列。是否可以? 一些伪代码:
`constructor ->
this.columns =
[
{
name: "name",
title: "Name",
}, ....
]
<DataGrid
domain={"manageLocations"}
columns={this.columns}
context={context}
// rows={test_locations}
dataPath={"locations"}
getRowId={this.getRowId}
pagingEnabled={this.pagingEnabled}
pagingRemote={this.pagingRemote} ......
`
问题是,当我尝试将新状态传递给列时,Grid 没有更新
【问题讨论】:
-
关于你所取得的成就的任何代码?
标签: reactjs