question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic table columns

See original GitHub issue

Possible that I’m being slow (react newbie), but I’m having an issue creating dynamic columns (from other posts, it looks like it’s possible!):

My code is as follows: `

   <BootstrapTable data={this.state.tableData}>

  <TableHeaderColumn dataField="location" dataSort={true}
              isKey={true}>Location</TableHeaderColumn>
   {
             this.state.tableColumns.map(function (elem, index) {
             return <TableHeaderColumn dataField={period} key={index} dataSort={true}>{periodtxt}        
   </TableHeaderColumn>
     })
 }


 </BootstrapTable>

` However, this gives me a “Cannot read property ‘dataField’ of undefined” - it appears the child doesn’t have any props.

Any ideas what I’m doing wrong?

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
adamtay82commented, Apr 20, 2016

That did the trick - thanks @AllenFang and @rpastorelle !

0reactions
AllenFangcommented, Apr 20, 2016

thanks your repsponse @rpastorelle, and @adamtay82 you can check this issue, it’s absolutely same as yours

Read more comments on GitHub >

github_iconTop Results From Across the Web

Power BI - Dynamic Columns in a Table - YouTube
What's up guys! Parker here. In this video, I take you through a quick tutorial to demonstrate how to set up dynamic columns...
Read more >
Table Records with dynamic columns | OutSystems
Hi guys, I need to have table records where the columns are dynamic and I have no more ideas on how to do...
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 >
Table dynamically changing the columns displayed - StackBlitz
Table dynamically changing the columns displayed.
Read more >
Create a table with dynamic columns - Cubewise CODE
The objective is to create a table with rows and columns driven by a subset. By having your table driven by subsets, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found