Conditionally specify columns does not work
See original GitHub issueI want conditionally specify which columns table will have. Usually I use ternary operator to hide something in the React by this does not work with React Bootstrap table. See example below.
export const BetDistributionTable = (props: BetDistributionTableProperties) => {
const betType = props.showBetType
? <TableHeaderColumn width="200" dataField="betType" dataSort={true} isKey={true}>Тип ставки</TableHeaderColumn>
: null;
return <BootstrapTable data={props.data} bordered condensed hover trClassName=""
options={{ defaultSortName: "date", defaultSortOrder: "desc" }}>
<TableHeaderColumn width="200" dataField="date" dataSort={true} isKey={true}
dataFormat={dateFormatter}>Date</TableHeaderColumn>
{betType}
</BootstrapTable>;
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
SQL Conditional column data return in a select statement
What I would like to do is have the select not display the Assignee name if the worksteam is internal. Instead to display...
Read more >Add a conditional column (Power Query) - Microsoft Support
To open a query, locate one previously loaded from the Power Query Editor, select a cell in the data, and then select Query...
Read more >Conditional column with does NOT include and OR criteria
Hello, what is the best way to set up a conditional column in the following scenario: COLUMN DESIRED OUTCOME (isolate all 'C') A....
Read more >Conditional Column in Power BI using Power Query; You can ...
You can choose the value as the Output or Value to come from ... The problem of creating a conditional column with the...
Read more >Conditionally allow column edits (Editable_If) - AppSheet Help
By administrators or specific users, but not others. · When another column has a specific value. · When adding a new row, but...
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
ok, got it, but one more question, if you used
hidden
onTableHeaderColumn
is helpful for you?The problem not in the isKey or such. I think very often in React use following pattern
When I construct
<TableHeaderColumn>
objects like that React Bootstrap table does not like it.I have table with 10 columns and couple of them could be shown/hidden as needed. I definitely could create workaround which will produce array of
<TableHeaderColumn>
components but think that RBT will benefit from having such simple way to dynamically create columns.