With this code you can create a DataGrid dynamically. Reset the 'columns' state to re-render the DataGrid.
<DataGrid data={this.state.data} style={{height:250}}>
{
this.state.columns.map((col,index) => (
<GridColumn key={index} {...col}></GridColumn>
))
}
</DataGrid>
Thanks for reply. Yes i already using this code i got it from sample react nested grid code.
defining columns in state
columns: [
{
field: 'id',
title: 'userid',
hidden: true ----------->>>> doesnt worked
}
{
field: 'name',
title: 'username',
width: 200,
formatter: function(value) { --------------------------------->>> formatter doesnt worked
return "<button>value</button>"
}
}
]