Hi for A Project i need the user to select the Columns that should be displayed in the React Data Grid. Some Columns might be preset ,others may be added later. However i tryed, it won´t work for more than one added Column eventhough the state is set accordingly and no error is displayed
The new Column will be Selcted by a Selector.This will than be added to the State of the tableclass. If tried passing it down by props which forced the render method but it did not updated the columns more than once either. I used different/same keysets. Sames will be recognised if it was the first new Column. I tried to debug it wether there is any Reason to classify nextColumns as not changed but it did´t bring me any closer.
The state.columns while in render()
0: {key: "date", name: "Date"} ->Preset
1: {key: "date", name: "Date1"} ->Added and created
2: {key: "ffd", name: "Testfdg2"}->Added to state not created
3: {key: "test", name: "Test3"} ->Not created
4: {key: "test", name: "Test4"}
5: {key: "test", name: "Test5"}
6: {key: "test", name: "Test6"}
length: 7
__proto__: Array(0)
ComponentCall
<ReactDataGrid
columns={this.state.columns}
rowGetter={i => this.handleRowGetter(i)}
rowsCount={this.rowsCount()}
minHeight={500}
minColumnWidth={10}
onGridSort={(sortColumn, sortDirection)=>this.gridSort(sortColumn, sortDirection)}
toolbar={
<Toolbar enableFilter={true}
/>}
onAddFilter={this.handleFilterChange}
onClearFilters={this.handleOnClearFilters}
onRowDoubleClick={(click,row) =>{this.handleClick(click,row)}}
/>
So the Goal would be to create all the Columns according to the State
If more Code is nessesary i´l gladly provide it
Greeting Jonathan