Dynamically generated columns
See original GitHub issueDo you know of a way to dynamically generate columns? I have something like this in mind (inside the render
method):
const columns = ["name", "description", "age"];
return (
<BootstrapTable data={someData}>
<TableHeaderColumn isKey dataField="id">id</TableHeaderColumn>
{columns.map(column =>
<TableHeaderColumn dataField={column}>{column}</TableHeaderColumn>
)}
</BootstrapTable>
)
This seems like it would be a very efficient way of producing tables when you don’t know the columns ahead of time. When I try to do this however, if receive this error:
react-bootstrap-table.min.js?3226:6 Uncaught TypeError: Cannot read property 'children' of undefined
This makes me think that react-bootstrap-table might not be implemented in such a way that it supports this. I just wanted to see your thoughts.
Thanks for an awesome tool!
Issue Analytics
- State:
- Created 7 years ago
- Comments:24 (4 by maintainers)
Top Results From Across the Web
Dynamically create columns sql - Stack Overflow
You will want to use a PIVOT function for this. If you have a known number of columns, then you can hard-code the...
Read more >Solved: Re: (Table) Add dynamically generated columns (fro...
(Table) Add dynamically generated columns (from field values) onto pre-existing columns ; CartridgeType, Cartridge, SVP:A-1 ; User, Alpha, 1.4.
Read more >Creating Dynamic Columns | Power Query Challenge - YouTube
Download Data - https://goodly.co.in/wp-content/uploads/2022/07/ Create - Dynamic - Columns -Power-Query-Output.xlsx➜ Post Your Answers Here ...
Read more >how do i can create columns in sql dynamically? - Microsoft Q&A
First of all, whether your metadata only has the PostMonth column, and how to guarantee the value of the new column and row,...
Read more >Using FixedColumns with dynamically generated columns
Using FixedColumns with dynamically generated columns ... I have an empty table (no headers, no rows, etc.), with everything inside is initialized ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
HI, try following way:
Ah I see. The problem is trying to create one column manually and the rest in the map. When all of them are created in the map, it works great. Thank you!