admin管理员组文章数量:1332352
I am using react-data-grid for displaying an editable table in a page. I have used editable: true
for enabling editable columns. But i have some rows which are non-editable. How can i control this in row-level?
Please suggest a solution. PFB the initialization of data grid.
<ReactDataGrid
enableCellSelect={true}
columns={this.state.columns}
rowGetter={rowGetter}
rowsCount={this.state.rows.length}
rowHeight={35}
minHeight={500}
onGridRowsUpdated={this.handleGridRowsUpdated}/>
I am using react-data-grid for displaying an editable table in a page. I have used editable: true
for enabling editable columns. But i have some rows which are non-editable. How can i control this in row-level?
Please suggest a solution. PFB the initialization of data grid.
<ReactDataGrid
enableCellSelect={true}
columns={this.state.columns}
rowGetter={rowGetter}
rowsCount={this.state.rows.length}
rowHeight={35}
minHeight={500}
onGridRowsUpdated={this.handleGridRowsUpdated}/>
Share
Improve this question
edited Apr 19, 2017 at 8:49
Lini Susan V
asked Apr 10, 2017 at 6:41
Lini Susan VLini Susan V
1,1951 gold badge9 silver badges26 bronze badges
1 Answer
Reset to default 9ReactDataGrid takes "editable" as input function.
Here, we can pass out custom logic to determine if edit is allowed for the specific cell.
columns = [
{
key: 'id',
name: 'ID'
},
{
key: 'location_id',
name: 'Location ID',
editable: function(rowData) {
return rowData.allowEdit === true;
}
}
]
本文标签: javascriptCan we make some rows noneditable in reactdatagridStack Overflow
版权声明:本文标题:javascript - Can we make some rows non-editable in react-data-grid? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742322229a2453020.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论